# Understanding memory usage in Julia

**URL:** <https://discourse.julialang.org/t/understanding-memory-usage-in-julia/101647>\
**Category:** Performance\
**Tags:** memory, memory-allocation\
**Created:** [July 15, 2023, 8:20am UTC](https://discourse.julialang.org/t/understanding-memory-usage-in-julia/101647 "2023-07-15T08:20:00Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [July 24, 2023, 4:21pm UTC](https://discourse.julialang.org/t/understanding-memory-usage-in-julia/101647/21 "2023-07-24T16:21:05Z")

</div>

I added:

```julia
if Sys.free_memory()/2^30 < 6.0
    GC.gc()
end

```

to large functions that are called by pmap…

I think there is a bug in the garbage collector, this should not be needed…

Created a bug report: [Garbage collector not working · Issue #50658 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/50658)

---

_[View the full topic](https://discourse.julialang.org/t/understanding-memory-usage-in-julia/101647)._
