The state of Rust allocators in 2026: stabilised (opens external site)
View full thread · View on Hacker News
To get push notifications on iPhone or iPad, add Hack and Chat to your Home Screen: tap Share → Add to Home Screen, then open the installed app and enable push in Settings.
View full thread · View on Hacker News
> A request comes in, fills in some data structures, and then when the request finishes, the memory isn't needed anymore so it's dropped. This sort of "burst" pattern of allocation, where you allocate a lot up front, and then tear things down all at once at the end, is quite common.
FYI: Generational garbage collectors, such as the one used in the dotnet framework since the beginning (~2002), are very good at handling this.
Basically, the 0 generation starts as a large chunk of memory, and before a slow "mark and sweep" the reachable objects that are in the 0 generation are copied to the 1 generation. This implicitly deallocates unreachable objects in the 0 generation.
(Then again, there are a lot of tradeoffs to using a garbage collected language vs. Rust. I find that a program in Rust, vs an equivalent in C#, has a significantly lower RAM footprint.)
Replies (1)
Replies (1)
I also would never call Rust a garbage collected language. It's more like a language where the compiler enforces memory safety. The difference is that it's on the programmer (or AI) to write correct code; and correct code includes implicit deallocations; but you still need to manage cyclic loops in RC or ARC.