Pathological Cases for a Class of Reachability-Based Garbage Collectors
Matthew Sotoudeh
Abstract
Although existing garbage collectors (GCs) perform extremely well on typical programs, there still exist pathological programs for which modern GCs significantly degrade performance. This observation begs the question: might there exist a 'holy grail' GC algorithm, as yet undiscovered, guaranteeing both constant-length pause times and that memory is collected promptly upon becoming unreachable? For decades, researchers have understood that such a GC is not always possible, i.e., some pathological behavior is unavoidable when the program can make heap cycles and operates near the memory limit, regardless of the GC algorithm used. However, this understanding has until now been only informal, lacking a rigorous formal proof.
This paper complements that informal understanding with a rigorous proof, showing with mathematical certainty that every GC algorithm that can implement a realistic mutator-observer interface has some pathological program that forces it to either introduce a long GC pause into program execution or reject an allocation even though there is available space. Hence, language designers must either accept these pathological scenarios and design heuristic approaches that minimize their impact (e.g., generational collection), or restrict programs and environments to a strict subset of the behaviors allowed by our mutator-observer-style interface (e.g., by enforcing a type system that disallows cycles or overprovisioning memory).
We do not expect this paper to have any effect on garbage collection practice. Instead, it provides the first mathematically rigorous answers to these interesting questions about the limits of garbage collection. We do so via rigorous reductions between GC and the dynamic graph reachability problem in complexity theory, so future algorithms and lower bounds from either community transfer to the other via our reductions.
We end by describing how to adapt techniques from the graph data structures community to build a garbage collector making worst-case guarantees that improve performance on our motivating, pathologically memory-constrained scenarios, but in practice find too much overhead to recommend for typical use.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext f47da8c9-54aa-4c0a-a3e5-d637dbdecf22Builds on3
- A marriage of pointer- and epoch-based reclamationJeehoon Kang, Jaehwang JungPLDI 2020 · 25 citations
- Garbage Collection Makes Rust Easier to Use: A Randomized Controlled Trial of the Bronze Garbage CollectorMichael Coblenz, Michelle L. Mazurek, Michael HicksICSE 2022 · 9 citations
- Super-Logarithmic Lower Bounds for Dynamic Graph ProblemsKasper Green Larsen, Huacheng YuFOCS 2023 · 2 citations
Related papers
- Uncovering Hidden Memory Costs for Garbage CollectionSudhanshu Agarwal, Saugata GhoseOOPSLA 2026
- Do you have space for dessert? a verified space cost semantics for CakeML programsAlejandro Gómez-Londoño, Johannes Åman Pohjola, Hira Taqdees Syeda, Magnus O. Myreen et al.OOPSLA 2020 · 12 citations
- Jade: A High-throughput Concurrent Copying Garbage CollectorMingyu Wu, Liang Mao, Yude Lin, Yifeng Jin et al.EuroSys 2024 · 5 citations
- Work Packets: A New Abstraction for GC Software Engineering, Optimization, and InnovationWenyu Zhao, Stephen M. Blackburn, Kathryn S. McKinleyOOPSLA 2025 · 3 citations
- Optimal heap limits for reducing browser memory useMarisa Kirisame, Pranav Shenoy, Pavel PanchekhaOOPSLA 2022 · 5 citations
