Concurrent Cycle Collection in Reference Counted Systems
Automatic storage reclamation via reference counting has important advantages, but has always suffered from a major weakness due to its inability to reclaim cyclic data structures.
We describe a novel cycle collection algorithm that is both concurrent — it is capable of collecting garbage even in the presence of simultaneous mutation — and localized—it never needs to perform a global search of the entire data space. We describe our algorithm in detail and present a proof of correctness. We have implemented our algorithm in the Jalapeño Java virtual machine as part of the Recycler, a concurrent multiprocessor reference counting garbage collector that achieves maximum mutator pause times of only 6 milliseconds. We present measurements of the behavior of the cycle collection algorithm over a set of eight benchmarks that demonstrate the effectiveness of the algorithm at finding garbage cycles, handling concurrent mutation, and eliminating global tracing.
KeywordsGarbage Collection Race Condition Live Node Garbage Collector Reference Count
Unable to display preview. Download preview PDF.
- Alpern, B., ET AL. Implementing Jalañpeño in Java. In OOPSLA’99 Conference Proceedings: Object-Oriented Programming Systems, Languages, and Applications (Denver, Colorado, Oct. 1999). SIGPLAN Notices 34, 10, 314–324.Google Scholar
- Appel, A.W., Ellis, J. R., and Li, K. Real-time concurrent collection on stock multiprocessors. In Proceedings of the SIGPLAN Conference on Programming Language Design and Implementation (Atlanta, Georgia, June 1988). SIGPLAN Notices, 23, 7 (July), 11–20.Google Scholar
- Bacon, D. F., Attanasio, C. R., Lee, H. B., Rajan, V. T., AND Smith, S. Java without the coffee breaks: A nonintrusive multiprocessor garbage collector. In Proceedings of the SIGPLAN Conference on Programming Language Design and Implementation (Snowbird, Utah, June 2001). SIGPLAN Notices, 36, 5 (May).Google Scholar
- Bacon, D. F., Kolodner, H., Nathaniel, R., Petrank, E., AND Rajan, V. T. Strongly-connected component algorithms for concurrent cycle collection. Tech. rep., IBM T.J. Watson Research Center and IBM Haifa Scientific Center, Apr. 2001.Google Scholar
- Detreville, J. Experience with concurrent garbage collectors for Modula-2+. Tech. Rep. 64, DEC Systems Research Center, Palo Alto, California, Aug. 1990.Google Scholar
- Dijkstra, E. W., Lamport, L., Martin, A. J., Scholten, C. S., AND Steffens, E. F. M. On-the-fly garbage collection: An exercise in cooperation. In Hierarchies and Interfaces, F. L. Bauer et al., Eds., vol. 46 of Lecture Notes in Computer Science. Springer-Verlag, New York, 1976, pp. 43–56.Google Scholar
- Doligez, D., AND Leroy, X. A concurrent generational garbage collector for a multithreaded implementation of ML. In Conference Record of the Twentieth ACM Symposium on Principles of Programming Languages (Charleston, South Carolina, Jan. 1993), ACM Press, New York, New York, pp. 113–123.Google Scholar
- Domani, T., ET AL. Implementing an on-the-fly garbage collector for Java. In Proceedings of the ACM SIGPLAN International Symposium on Memory Management (Minneapolis, MN, Oct. 2000). SIGPLAN Notices, 36, 1, 155–166.Google Scholar
- Huelsbergen, L., AND Winterbottom, P. Very concurrent mark-&-sweep garbage collection without fine-grain synchronization. In Proceedings of the ACM SIGPLAN International Symposium on Memory Management (Mar. 1999). SIGPLAN Notices, 34, 3, 166–174.Google Scholar
- Jones, R. E., AND Lins, R. D. Cyclic weighted reference counting without delay. In PARLE’93 Parallel Architectures and Languages Europe (June 1993), A. Bode, M. Reeve, and G. Wolf, Eds., vol. 694 of Lecture Notes in Computer Science, Springer-Verlag, pp. 712–715.Google Scholar
- Jones, R. E., AND Lins, R. D. Garbage Collection. John Wiley and Sons, 1996.Google Scholar
- Kung, H. T., AND Song, S. W. An efficient parallel garbage collection system and its correctness proof. In IEEE Symposium on Foundations of Computer Science (1977), IEEE Press, New York, New York, pp. 120–131.Google Scholar
- Lamport, L. Garbage collection with multiple processes: an exercise in parallelism. In Proceedings of the 1976 International Conference on Parallel Processing (1976), pp. 50–54.Google Scholar
- Nettles, S., AND O’Toole, J. Real-time garbage collection. In Proceedings of the SIGPLAN Conference on Programming Language Design and Implementation (Albuquerque, New Mexico, June 1993). SIGPLAN Notices, 28, 6, 217–226.Google Scholar
- Rodrigues, H. C. C. D., AND Jones, R. E. Cyclic distributed garbage collection with group merger. In Proceedings of the Twelfth European Conference on Object-Oriented Programming (Brussels, July 1998), E. Jul, Ed., vol. 1445 of Lecture Notes in Computer Science, Springer-Verlag, pp. 249–273.Google Scholar
- Rovner, P. On adding garbage collection and runtime types to a strongly-typed, staticallychecked, concurrent language. Tech. Rep. CSL-84-7, Xerox Palo Alto Research Center, July 1985.Google Scholar