# Profile garbage collection?

**URL:** <https://discourse.julialang.org/t/profile-garbage-collection/73263>\
**Category:** Performance\
**Tags:** profiling, garbage-collection\
**Created:** [December 17, 2021, 3:05pm UTC](https://discourse.julialang.org/t/profile-garbage-collection/73263 "2021-12-17T15:05:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [December 17, 2021, 3:05pm UTC](https://discourse.julialang.org/t/profile-garbage-collection/73263/1 "2021-12-17T15:05:00Z")

</div>

Is there a way to profile the garbage collection? For example, to trace which are the variables that are being collected?

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [December 17, 2021, 3:11pm UTC](https://discourse.julialang.org/t/profile-garbage-collection/73263/2 "2021-12-17T15:11:34Z")

</div>

Is [Profiling · The Julia Language](https://docs.julialang.org/en/v1/manual/profile/#External-Profiling) what you want?

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [December 17, 2021, 4:22pm UTC](https://discourse.julialang.org/t/profile-garbage-collection/73263/3 "2021-12-17T16:22:45Z")

</div>

Maybe, I will try it. Thanks!

---

<div class="post-metadata">

**Author:** ![woclass](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/woclass/32/212699_2.png) [@woclass](https://discourse.julialang.org/u/woclass)\
**Post date:** [December 18, 2021, 5:36am UTC](https://discourse.julialang.org/t/profile-garbage-collection/73263/4 "2021-12-18T05:36:24Z")

</div>

Some profiling options in source code:

[https://github.com/JuliaLang/julia/blob/eea8b14a704d3160593a49dd01cc254ebf18d514/src/options.h#L72-L84](https://github.com/JuliaLang/julia/blob/eea8b14a704d3160593a49dd01cc254ebf18d514/src/options.h#L72-L84)

And some WIP profile tools:

[https://github.com/JuliaLang/julia/pull/42286](https://github.com/JuliaLang/julia/pull/42286)

[https://github.com/JuliaLang/julia/pull/42768](https://github.com/JuliaLang/julia/pull/42768)
