Concurrent Cycle Collection in Reference Counted Systems

  • David F. Bacon
  • V. T. Rajan
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2072)


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.


Garbage Collection Race Condition Live Node Garbage Collector Reference Count 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    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
  2. [2]
    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
  3. [3]
    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
  4. [4]
    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
  5. [5]
    Bobrow, D. G. Managing re-entrant structures using reference counts. ACM Trans. Program. Lang. Syst 2. , 3 (July 1980), 269–273.CrossRefMathSciNetGoogle Scholar
  6. [6]
    Christopher, T. W. Reference count garbage collection. Software-Practice and Experience 14 , 6 (June 1984), 503–507.CrossRefGoogle Scholar
  7. [7]
    Collins, G. E. A method for overlapping and erasure of lists. Commun. ACM 3, 12 (Dec. 1960), 655–657.CrossRefGoogle Scholar
  8. [8]
    Detreville, J. Experience with concurrent garbage collectors for Modula-2+. Tech. Rep. 64, DEC Systems Research Center, Palo Alto, California, Aug. 1990.Google Scholar
  9. [9]
    Deutsch, L. P., AND Bobrow, D. G. An efficient incremental automatic garbage collector. Commun. ACM 19, 7 (July 1976), 522–526.zbMATHCrossRefGoogle Scholar
  10. [10]
    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
  11. [11]
    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
  12. [12]
    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
  13. [13]
    Domani, T., Kolodner, E. K., AND Petrank, E. A generational on-the-fly garbage collector for Java. In Proceedings of the SIGPLAN Conference on Programming Language Design and Implementation (June 2000). SIGPLAN Notices, 35, 6, 274–284.CrossRefGoogle Scholar
  14. [14]
    Huelsbergen, L., AND Larus, J. R. A concurrent copying garbage collector for languages that distinguish (im)mutable data. In Proceedings of the Fourth ACM Symposium on Principles and Practice of Parallel Programming (May 1993). SIGPLAN Notices, 28, 7 (July), 73–82.CrossRefGoogle Scholar
  15. [15]
    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
  16. [16]
    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
  17. [17]
    Jones, R. E., AND Lins, R. D. Garbage Collection. John Wiley and Sons, 1996.Google Scholar
  18. [18]
    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
  19. [19]
    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
  20. [20]
    Lins, R. D. Cyclic reference counting with lazy mark-scan. Inf. Process. Lett. 44, 4 (Dec. 1992), 215–220.zbMATHCrossRefGoogle Scholar
  21. [21]
    Lins, R. D. A multi-processor shared memory architecture for parallel cyclic reference counting. Microprocessing and Microprogramming 35, 1–5 (Sept. 1992), 563–568. Proceedings of the 18th EUROMICRO Conference (Paris, France).CrossRefGoogle Scholar
  22. [22]
    Martínez, A. D., Wachenchauzer, R., AND Lins, R. D. Cyclic reference counting with local mark-scan. Inf. Process. Lett 34., 1 (1990), 31–35.zbMATHCrossRefGoogle Scholar
  23. [23]
    Mccarthy, J. Recursive functions of symbolic expressions and their computation by machine. Commun. ACM 3 (1960), 184–195.zbMATHCrossRefGoogle Scholar
  24. [24]
    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
  25. [25]
    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
  26. [26]
    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
  27. [27]
    Steele, G. L. Multiprocessing compactifying garbage collection. Commun. ACM 18, 9 (Sept. 1975), 495–508.zbMATHCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • David F. Bacon
    • 1
  • V. T. Rajan
    • 1
  1. 1.IBM T.J.Watson Research CenterYorktown HeightsUSA

Personalised recommendations