Abstract
Abstract
Reclaiming cyclic garbage has been a long-standing challenge in automatic memory management. Common approaches to this problem often involve extending reference counting with an asynchronous background task to reclaim cycles. While this ensures that cycles are eventually collected, it also introduces unpredictable behaviours, making these approaches unsuitable for applications where deterministic collection is required.
This paper introduces Arborescent Garbage Collection, a synchronous memory management algorithm that immediately reclaims unreachable memory objects, including cyclic structures. Inspired by single-source reachability algorithms on dynamic graphs, it extends the idea of embedding a spanning forest in a program's reference graph to track the reachability of any object from a root. When a reference is removed, the algorithm efficiently rebuilds the forest and immediately reclaims the memory of objects that are no longer reachable. The result is a garbage collection algorithm suitable for applications that require immediate memory reclamation and predictable behaviour.
AI Summary
AI-Generated Summary (Experimental)
This summary was generated using automated tools and was not authored or reviewed by the article's author(s). It is provided to support discovery, help readers assess relevance, and assist readers from adjacent research areas in understanding the work. It is intended to complement the author-supplied abstract, which remains the primary summary of the paper. The full article remains the authoritative version of record. Click here to learn more.
Click here to comment on the accuracy, clarity, and usefulness of this summary. Doing so will help inform refinements and future regenerated versions.
To view this AI-generated plain language summary, you must have Premium access.
Formats available
You can view the full content in the following formats:
Supplemental Material
MP4 File - Arborescent Garbage Collection: A Dynamic Graph Approach to Immediate Cycle Collection (Video)
Video of conference presentation
- Download
- 1222.82 MB
References
[1]
2025. R7RS Benchmarks. https://github.com/ecraven/r7rs-benchmarks
[2]
David F. Bacon and V. T. Rajan. 2001. Concurrent Cycle Collection in Reference Counted Systems. In ECOOP 2001 - Object-Oriented Programming, 15th European Conference, Budapest, Hungary, June 18-22, 2001, Proceedings, Jørgen Lindskov Knudsen (Ed.) (Lecture Notes in Computer Science, Vol. 2072). Springer, 207–235. https://doi.org/10.1007/3-540-45337-7_12
[3]
Joshua Bloch. 2008. Creating and Destroying Objects (2nd ed.). Addison-Wesley Professional.
[4]
Hans-J. Boehm. 2003. Destructors, finalizers, and synchronization. SIGPLAN Not., 38, 1 (2003), Jan., 262–272. issn:0362-1340 https://doi.org/10.1145/640128.604153
[5]
Steven R. Brandt, Hari Krishnan, Costas Busch, and Gokarna Sharma. 2018. Distributed garbage collection for general graphs. In Proceedings of the 2018 ACM SIGPLAN International Symposium on Memory Management, ISMM 2018, Philadelphia, PA, USA, June 18, 2018, Hannes Payer and Jennifer B. Sartor (Eds.). ACM, 29–44. https://doi.org/10.1145/3210563.3210572
[6]
Steven R. Brandt, Hari Krishnan, Gokarna Sharma, and Costas Busch. 2014. Concurrent, parallel garbage collection in linear time. In International Symposium on Memory Management, ISMM ’14, Edinburgh, United Kingdom, June 12, 2014, David Grove and Samuel Z. Guyer (Eds.). ACM, 47–58. https://doi.org/10.1145/2602988.2602990
[7]
David R. Brownbridge. 1985. Cyclic Reference Counting for Combinator Machines. In Functional Programming Languages and Computer Architecture, FPCA 1985, Nancy, France, September 16-19, 1985, Proceedings, Jean-Pierre Jouannaud (Ed.) (Lecture Notes in Computer Science, Vol. 201). Springer, 273–288. https://doi.org/10.1007/3-540-15975-4_42
[8]
George E. Collins. 1960. A method for overlapping and erasure of lists. Commun. ACM, 3, 12 (1960), Dec., 655–657. issn:0001-0782 https://doi.org/10.1145/367487.367501
[9]
Intel Corporation. 2025. Intel® 64 and IA-32 Architectures Software Developer’s Manual - Volume 3. 19–42 to 19–44. https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html
[10]
Shimon Even and Yossi Shiloach. 1981. An On-Line Edge-Deletion Problem. J. ACM, 28, 1 (1981), 1–4. https://doi.org/10.1145/322234.322235
[11]
Alexander Fedorov, Nikita Koval, and Dan Alistarh. 2021. A Scalable Concurrent Algorithm for Dynamic Connectivity. In Proceedings of the 33rd ACM Symposium on Parallelism in Algorithms and Architectures (SPAA ’21). Association for Computing Machinery, New York, NY, USA. 208–220. isbn:9781450380706 https://doi.org/10.1145/3409964.3461810
[12]
Saverio Giallorenzo and Francesco Goretti. 2025. Breadth-first Cycle Collection Reference Counting: Theory and a Rust Smart Pointer Implementation. In ACM digital library. Catania (IT), Italy. https://doi.org/10.1145/3672608.3707785
[13]
Pramod G. Joisha. 2006. Compiler optimizations for nondeferred reference: counting garbage collection. In Proceedings of the 5th International Symposium on Memory Management (ISMM ’06). Association for Computing Machinery, New York, NY, USA. 150–161. isbn:1595932216 https://doi.org/10.1145/1133956.1133976
[14]
Jaehwang Jung, Jeonghyeon Kim, Matthew J. Parkinson, and Jeehoon Kang. 2024. Concurrent Immediate Reference Counting. Proc. ACM Program. Lang., 8, PLDI (2024), Article 153, June, 24 pages. https://doi.org/10.1145/3656383
[15]
Yossi Levanoni and Erez Petrank. 2006. An on-the-fly reference-counting garbage collector for java. ACM Trans. Program. Lang. Syst., 28, 1 (2006), Jan., 1–69. issn:0164-0925 https://doi.org/10.1145/1111596.1111597
[16]
Henry Lieberman and Carl Hewitt. 1983. A real-time garbage collector based on the lifetimes of objects. Commun. ACM, 26, 6 (1983), June, 419–429. issn:0001-0782 https://doi.org/10.1145/358141.358147
[17]
Chin-Yang Lin and Ting-Wei Hou. 2007. A simple and efficient algorithm for cycle collection. ACM SIGPLAN Notices, 42, 3 (2007), 7–13. https://doi.org/10.1145/1273039.1273041
[18]
Rafael Dueire Lins. 1992. Cyclic Reference Counting with Lazy Mark-Scan. Inf. Process. Lett., 44, 4 (1992), 215–220. https://doi.org/10.1016/0020-0190(92)90088-D
[19]
Léonard Oest O’Leary and Marc Feeley. 2023. A Compact and Extensible Portable Scheme VM. In Companion Proceedings of the 7th International Conference on the Art, Science, and Engineering of Programming (Programming ’23). Association for Computing Machinery, New York, NY, USA. 3–6. isbn:9798400707551 https://doi.org/10.1145/3594671.3594672
[20]
Léonard Oest O’Leary, Mathis Laroche, and Marc Feeley. 2023. A R4RS Compliant REPL in 7 KB. CoRR, abs/2310.13589 (2023), https://doi.org/10.48550/ARXIV.2310.13589
[21]
Oracle Corporation. 2025. Object (Java SE 17 & JDK 17). https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html##finalize()
[22]
José M. Piquer. 1991. Indirect Reference Counting: A Distributed Garbage Collection Algorithm. In PARLE ’91: Parallel Architectures and Languages Europe, Volume I: Parallel Architectures and Algorithms, Eindhoven, The Netherlands, June 10-13, 1991, Proceedings, Emile H. L. Aarts, Jan van Leeuwen, and Martin Rem (Eds.) (Lecture Notes in Computer Science, Vol. 505). Springer, 150–165. https://doi.org/10.1007/BFB0035102
[23]
Python Software Foundation. 2025. Data Model - Python 3.13. https://docs.python.org/3/reference/datamodel.html##object.__del__
[24]
Alex Reinking, Ningning Xie, Leonardo de Moura, and Daan Leijen. 2021. Perceus: garbage free reference counting with reuse. In Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation (PLDI 2021). Association for Computing Machinery, New York, NY, USA. 96–111. isbn:9781450383912 https://doi.org/10.1145/3453483.3454032
[25]
Ruby Core Team. 2025. module ObjectSpace - Documentation for Ruby 3.5. https://docs.ruby-lang.org/en/master/ObjectSpace.html##method-c-define_finalizer
[26]
Michael Schöttner, Ralph Göckelmann, Stefan Frenz, Markus Fakler, and Peter Schulthess. 2006. Incremental Distributed Garbage Collection Using Reverse Reference Tracking. In Euro-Par 2006, Parallel Processing, 12th International Euro-Par Conference, Dresden, Germany, August 28 - September 1, 2006, Proceedings, Wolfgang E. Nagel, Wolfgang V. Walter, and Wolfgang Lehner (Eds.) (Lecture Notes in Computer Science, Vol. 4128). Springer, 571–581. https://doi.org/10.1007/11823285_59
[27]
Matthew Sotoudeh. 2025. Pathological Cases for a Class of Reachability-Based Garbage Collectors. Proc. ACM Program. Lang., 9, OOPSLA1 (2025), Article 96, April, 28 pages. https://doi.org/10.1145/3720430
[28]
Sebastian Ullrich and Leonardo de Moura. 2021. Counting immutable beans: reference counting optimized for purely functional programming. In Proceedings of the 31st Symposium on Implementation and Application of Functional Languages (IFL ’19). Association for Computing Machinery, New York, NY, USA. Article 3, 12 pages. isbn:9781450375627 https://doi.org/10.1145/3412932.3412935