# GC improvements ideas/progress

**URL:** https://discourse.julialang.org/t/gc-improvements-ideas-progress/99537
**Category:** Internals & Design
**Created:** [May 29, 2023, 4:37am UTC](https://discourse.julialang.org/t/gc-improvements-ideas-progress/99537 "2023-05-29T04:37:36Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Tarny\_GG\_Channie](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)
#### Post date: [May 29, 2023, 4:37am UTC](https://discourse.julialang.org/t/gc-improvements-ideas-progress/99537/1 "2023-05-29T04:37:37Z")

</div>

Julia’s GC still has a long way to go. ideas/information on the state of Julia’s GC appreciated.  
I know some of these ideas will add LOTS of works. This is not supposed to be a list of things that MUST be done, but things that COULD be done.

My idea is to divide memories into pools. Objects that can be handled by simpler GC like reference counting or just compile-time ownership semantics may be separately managed. I’m not sure if it will work though.

---

<div class="post-metadata">

### Author: ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)
#### Post date: [May 29, 2023, 5:54am UTC](https://discourse.julialang.org/t/gc-improvements-ideas-progress/99537/2 "2023-05-29T05:54:29Z")

</div>

The GC is already using memory pools for different generations of memory (short, mid, long term), depending on how old an allocation is. Compile time known allocations that have a known finite lifetime don’t need to (and already aren’t) managed by GC - if the semantics guarantee that the allocation will be dead after a certain point and it’s known that the allocation doesn’t escape, it’s already allocated on the stack (or maybe even in registers only).

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [May 29, 2023, 7:51am UTC](https://discourse.julialang.org/t/gc-improvements-ideas-progress/99537/3 "2023-05-29T07:51:33Z")

</div>

> [@Tarny\_GG\_Channie](#):
>
> ideas/information on the state of Julia’s GC appreciated.

[https://docs.julialang.org/en/v1/devdocs/gc/](https://docs.julialang.org/en/v1/devdocs/gc/)

> **[Issues · JuliaLang/julia](https://github.com/JuliaLang/julia/issues?q=is%3Aopen%2Bis%3Aissue%2Blabel%3AGC)**
>
> The Julia Programming Language. Contribute to JuliaLang/julia development by creating an account on GitHub.

[https://github.com/JuliaLang/julia/pulls?q=is%3Aopen+is%3Apr+label%3AGC](https://github.com/JuliaLang/julia/pulls?q=is%3Aopen+is%3Apr+label%3AGC)

> [@Tarny\_GG\_Channie](#):
>
> Julia’s GC still has a long way to go.

Please be more specific when starting a discussion about Julia internals.

---

<div class="post-metadata">

### Author: ![mrufsvold](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mrufsvold/32/31600_2.png) [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)
#### Post date: [May 29, 2023, 3:25pm UTC](https://discourse.julialang.org/t/gc-improvements-ideas-progress/99537/4 "2023-05-29T15:25:16Z")

</div>

I had some “ideas” about GC as a novice and asked the experts to kindly explain why the problems are harder than I would expect [here](https://discourse.julialang.org/t/why-am-i-wrong-about-gc/91452).

I’d encourage you to read their responses because, I assure you, the folks working on this have thought of almost every idea a novice could come up with. If a novice have an idea that might be novel, it’s on us to do the reading and research to actually show that the approach is novel so we don’t waste the time of the people who are already in the trenches.

---

<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: [May 29, 2023, 3:43pm UTC](https://discourse.julialang.org/t/gc-improvements-ideas-progress/99537/5 "2023-05-29T15:43:29Z")

</div>

From my point of view a hard time limit (configurable) on the time that the GC blocks the world would be desirable. And I don’t think that this would be that difficult to implement, but I am not a GC expert.

---

<div class="post-metadata">

### Author: ![stemann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stemann/32/4030_2.png) [@stemann](https://discourse.julialang.org/u/stemann)
#### Post date: [May 29, 2023, 3:44pm UTC](https://discourse.julialang.org/t/gc-improvements-ideas-progress/99537/6 "2023-05-29T15:44:40Z")

</div>

> [@Tarny\_GG\_Channie](#):
>
> … reference counting

Regarding reference counting (and slightly off-topic): Is there (or should there be) reference counting in a package (or Base?), to avoid allocations (and hence GC) by re-using memory? Cf. my question in [Reference counting and disposables](https://discourse.julialang.org/t/reference-counting-and-disposables/98875)
