# Poor performance of garbage collection in multi-threaded application

**URL:** <https://discourse.julialang.org/t/poor-performance-of-garbage-collection-in-multi-threaded-application/75493>\
**Category:** Julia at Scale\
**Tags:** garbage-collection\
**Created:** [January 31, 2022, 9:47am UTC](https://discourse.julialang.org/t/poor-performance-of-garbage-collection-in-multi-threaded-application/75493 "2022-01-31T09:47:08Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![racinmat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/racinmat/32/11715_2.png) [@racinmat](https://discourse.julialang.org/u/racinmat)\
**Post date:** [February 2, 2022, 9:32am UTC](https://discourse.julialang.org/t/poor-performance-of-garbage-collection-in-multi-threaded-application/75493/12 "2022-02-02T09:32:26Z")

</div>

I have checked the discussion in [Garbage collection not aggressive enough on Slurm Cluster - Specific Domains / Julia at Scale - JuliaLang](https://discourse.julialang.org/t/garbage-collection-not-aggressive-enough-on-slurm-cluster/61649/18)  
specifically the

```julia
thr=0.02
rand(Uniform(0,1)) < thr && GC.gc();

```

And I’m trying now something similar now. Interestingly, when running the GC.gc() approximately every 100s, it does not seem to perform some deep cleaning. The low part on left is when there are no incoming requests, and then it grows under load and stays there.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/5/b/5b232bae896e0caf84962ad1753bcb8acc2be378.png)

I’ll also try the `Base.gc_bytes()` if it would give some more information.

I will yet try to sprinkle more `GC.safepoint()`.

---

_[View the full topic](https://discourse.julialang.org/t/poor-performance-of-garbage-collection-in-multi-threaded-application/75493)._
