Hacker News with Generative AI: Garbage Collection

New Go Garbage Collector (bsky.app)
Understanding Memory Management, Part 6: Basic Garbage Collection (educatedguesswork.org)
This is the sixth post in my multipart series on memory management. You will probably want to go back and read Part I, which covers C, parts II and III, which cover C++, and parts IV and V which cover Rust. C++ RAII and Rust do a lot to simplify memory management but still force you to constantly think about how you are using memory (this is even more true with Rust).
Let's build a Garbage Collector (GC) from scratch (buildx.substack.com)
Whippet GC notes on Guile, heuristics, and heap growth (wingolog.org)
Greets all! Another brief note today. I have gotten Guile working with one of the Nofl-based collectors, specifically the one that scans all edges conservatively (heap-conservative-mmc / heap-conservative-parallel-mmc). Hurrah!
A Garbage Collection Strategy (irreal.org)
One of the strengths—or weaknesses, depending on your point of view—of Lisp is garbage collection.
A sub-millisecond GC for .NET? (applied-algorithms.tech)
Howdy folks, I wanted to bring your attention to a Github discussion over in the .NET runtime where an experimental Garbage Collector called Satori has emerged that is producing very exciting numbers for those of us in the .NET performance crowd.
Pauseless Garbage Collector (github.com/dotnet)
Is there any reason why something like the Pauseless Garbage Collector wich exists for Java from Azul never was implemented for Dotnet?
Hazard Pointers in C++26 (modernescpp.com)
Hazard pointers provide garbage collection in C++ and solve the ABA problem.
Inheritance was invented as a performance hack (2021) (catern.com)
Inheritance was invented by the Simula language as a way to support intrusive lists, save memory, and simplify the garbage collector.
Green Tea: an experimental, memory-aware garbage collector for Go (github.com/golang)
This issue tracks the design and implementation of the Green Tea garbage collector. As of the last update to this issue, development of Green Tea is still active. We'll produce more detailed design document once we're ready to commit to a design. For now, Green Tea is available as an experiment at tip-of-tree and is planned as to be available as an opt-in experiment in Go 1.25, once it releases. We encourage teams to try it out.
Runtime: Green tea garbage collector (Go) (github.com/golang)
This issue tracks the design and implementation of the Green Tea garbage collector. As of the last update to this issue, development of Green Tea is still active. We'll produce more detailed design document once we're ready to commit to a design. For now, Green Tea is available as an experiment at tip-of-tree and is planned as to be available as an opt-in experiment in Go 1.25, once it releases. We encourage teams to try it out.
How ZGC allocates memory for the Java heap (joelsiks.com)
This post explores how ZGC, one of the garbage collectors in the OpenJDK, allocates memory for the Java heap, focusing on enhancements introduced in JDK-8350441 with the Mapped Cache. A garbage collector does much more than just collect garbage - and that’s what I want to unpack in this post. Whether you’re a Java nerd yearning for details, a GC enthusiast, or just curious about how ZGC uses memory behind the scenes, this deep dive is for you.
Writing a Simple Garbage Collector in C (maplant.com)
People seem to think that writing a garbage collector is really hard, a deep magic understood by a few great sages and Hans Boehm (et al). Well it’s not. In fact, it’s rather straight forward. I claim that the hardest part in writing a GC is writing the memory allocator, which is as hard to write as it is to look up the malloc example in K&R.
A mechanically verified garbage collector for OCaml [pdf] (kcsrk.info)
Low Overhead Allocation Sampling with VMProf in PyPy's GC (pypy.org)
There are many time-based statistical profilers around (like VMProf or py-spy just to name a few). They allow the user to pick a trade-off between profiling precision and runtime overhead.
Memory Hell (trynova.dev)
For a JavaScript engine, a garbage collector is one of those things one wishes one could avoid but simply cannot.
Writing a .NET Garbage Collector in C# – Part 1 (minidump.net)
If you read my articles, you probably know that I like playing with NativeAOT a lot, especially to use C# in places where it wasn’t possible before. I already wrote a simple profiler, this time we will go a step further and try to write a Garbage Collector in C#.
Baffled by generational garbage collection – wingolog (wingolog.org)
Usually in this space I like to share interesting things that I find out; you might call it a research-epistle-publish loop. Today, though, I come not with answers, but with questions, or rather one question, but with fractal surface area: what is the value proposition of generational garbage collection?
Practical use of the null garbage collector (2018) (microsoft.com)
Some time ago, I noted that the null garbage collector is a valid garbage collector if the amount of RAM available to the runtime is greater than the total memory requirements of the program.
Understanding JVM Garbage Collector Performance (mill-build.org)
Garbage collectors are a core part of many programming languages. While they generally work well, on occasion when they go wrong they can fail in very unintuitive ways. This article will discuss the fundamental design of how garbage collectors work, and tie it to real benchmarks of how GCs perform on the Java Virtual Machine.
Weak references and garbage collectors (bernsteinbear.com)
From 2018 to 2021, I worked on a greenfield Python runtime called Skybison. One of its major differences from CPython was that it used a moving garbage collector (GC). This I understood in theory—I knew that it ran when the heap filled up, knew we needed handles to update pointers in the runtime’s code, had read the Moon paper (PDF)—but the other day, I wanted to implement weak references and couldn’t immediately figure it out.
Weak references and garbage collectors (bernsteinbear.com)
From 2018 to 2021, I worked on a greenfield Python runtime called Skybison. One of its major differences from CPython was that it used a moving garbage collector (GC). This I understood in theory—I knew that it ran when the heap filled up, knew we needed handles to update pointers in the runtime’s code, had read the Moon paper (PDF)—but the other day, I wanted to implement weak references and couldn’t immediately figure it out.
Garbage collected smart pointers in Rust via concurrent cycle collection (maplant.com)
Ten years ago I wrote an article on how to implement a conservative garbage collector for C, and I got a lot of constructive criticism regarding the actual usefulness of the code presented. It only makes sense that on the ten-year anniversary of publishing I should try to fix my error by writing a garbage collector that is precise, does not make assumptions, and (hopefully) actually works.
Getting to Go: The Journey of Go's Garbage Collector (go.dev)
This is the transcript from the keynote I gave at the International Symposium on Memory Management (ISMM) on June 18, 2018.
Mark–Scavenge: Waiting for Trash to Take Itself Out (inside.java)
This blog post summarises a new garbage collection algorithm called Mark-Scavenge, which highlights how using reachability as a proxy for liveness in moving GCs leads to unnecessary data movement and how we can address this. This work is from the latest paper within the research collaboration between Oracle and Uppsala University. The full paper can be found on the ACM website.
A simple semi-space collector – wingolog (2022) (wingolog.org)
Good day, hackfolk. Today’s article is about semi-space collectors. Many of you know what these are, but perhaps not so many have seen an annotated implementation, so let’s do that.
Baby’s Second Garbage Collector (jennyjams.net)
This blog post is meant to an iteration on the tutorial and introduction to garbage collection implementation presented in this classic blog post. We are still working with simple garbage collectors, but this time another one with a bit more complexity.
CPython's Garbage Collector and Its Impact on Application Performance (codingconfessions.com)
Learn how the knowledge of CPython internals translate into performance insights for your code
Shenandoah GC (openjdk.org)
Shenandoah is the low pause time garbage collector that reduces GC pause times by performing more garbage collection work concurrently with the running Java program.
Next Generation Out of Band Garbage Collection (railsatscale.com)
In 2023, I wrote about how we’ve tuned Ruby’s garbage collector for Shopify’s monolith, including how we implemented out-of-band garbage collection to reduce the impact of major collection on latency.