# Potential memory leakage in function definition using multiple threads in linux?

**URL:** <https://discourse.julialang.org/t/potential-memory-leakage-in-function-definition-using-multiple-threads-in-linux/39613>\
**Category:** General Usage\
**Created:** [May 17, 2020, 3:15am UTC](https://discourse.julialang.org/t/potential-memory-leakage-in-function-definition-using-multiple-threads-in-linux/39613 "2020-05-17T03:15:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![samuel\_okon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/samuel_okon/32/10285_2.png) [@samuel\_okon](https://discourse.julialang.org/u/samuel_okon)\
**Post date:** [May 17, 2020, 3:15am UTC](https://discourse.julialang.org/t/potential-memory-leakage-in-function-definition-using-multiple-threads-in-linux/39613/1 "2020-05-17T03:15:39Z")

</div>

```julia
julia> versioninfo()
Julia Version 1.4.1
Commit 381693d3df* (2020-04-14 17:20 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i3-5005U CPU @ 2.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, broadwell)
Environment:
  JULIA_NUM_THREADS = 4

julia> @sync for i in 1:100
                  Threads.@spawn begin
                    function foo()
                      [fill(1.0, 2_00_000) for _ in 1:1000]
                      nothing
                    end
                    foo()
              end
              end

```

When i ran the above code which consumed 6.9G of ram (not the issue) after execution running `GC.gc()` multiple times only releases about (2.5G). I found a related github issue [Memory leak with function redefinition · Issue #30653 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/30653) which appears to have been fixed. Is this a bug??
