skip to main content
research-article

Down for the count? Getting reference counting back in the ring

Published:15 June 2012Publication History
Skip Abstract Section

Abstract

Reference counting and tracing are the two fundamental approaches that have underpinned garbage collection since 1960. However, despite some compelling advantages, reference counting is almost completely ignored in implementations of high performance systems today. In this paper we take a detailed look at reference counting to understand its behavior and to improve its performance. We identify key design choices for reference counting and analyze how the behavior of a wide range of benchmarks might affect design decisions. As far as we are aware, this is the first such quantitative study of reference counting. We use insights gleaned from this analysis to introduce a number of optimizations that significantly improve the performance of reference counting.

We find that an existing modern implementation of reference counting has an average 30% overhead compared to tracing, and that in combination, our optimizations are able to completely eliminate that overhead. This brings the performance of reference counting on par with that of a well tuned mark-sweep collector. We keep our in-depth analysis of reference counting as general as possible so that it may be useful to other garbage collector implementers. Our finding that reference counting can be made directly competitive with well tuned mark-sweep should shake the community's prejudices about reference counting and perhaps open new opportunities for exploiting reference counting's strengths, such as localization and immediacy of reclamation.

References

  1. B. Alpern, C. R. Attanasio, J. J. Barton, M. G. Burke, P. Cheng, J.-D. Choi, A. Cocchi, S. J. Fink, D. Grove, M. Hind, S. F. Hummel, D. Lieber, V. Litvinov, M. Mergen, T. Ngo, J. R. Russell, V. Sarkar, M. J. Serrano, J. Shepherd, S. Smith, V. C. Sreedhar, H. Srinivasan, and J. Whaley. The Jalapeño virtual machine. IBM Systems Journal, 39 (1): 211--238, February 2000. 10.1147/sj.391.0211. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. D. F. Bacon and V. T. Rajan. Concurrent cycle collection in reference counted systems. In European Conference on Object-Oriented Programming, pages 207--235, Budapest, Hungary, 2001. 10.1007/3-540-45337-7_12. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. D. F. Bacon, C. R. Attanasio, H. B. Lee, V. T. Rajan, and S. Smith. Java without the coffee breaks: A nonintrusive multiprocessor garbage collector. In ACM Conference on Programming Language Design and Implementation, pages 92--103, Snowbird, UT, USA, 2001. 10.1145/378795.378819. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. S. M. Blackburn and K. S. McKinley. Ulterior reference counting: Fast garbage collection without a long wait. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 344--358, Anaheim, CA, USA, 2003. 10.1145/949305.949336. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. S. M. Blackburn and K. S. McKinley. Immix: A mark-region garbage collector with space efficiency, fast collection, and mutator locality. In ACM Conference on Programming Language Design and Implementation, pages 22--32, Tucson, AZ, USA, 2008. 10.1145/1379022.1375586. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. S. M. Blackburn, P. Cheng, and K. S. McKinley. Oil and water? High performance garbage collection in Java with MMTk. In Proceedings of the 26th International Conference on Software Engineering, pages 137--146, Edinburgh, Scotland, UK, 2004\natexlaba. 10.1109/ICSE.2004.1317436. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. S. M. Blackburn, P. Cheng, and K. S. McKinley. Myths and realities: The performance impact of garbage collection. In Proceedings of the ACM Conference on Measurement & Modeling Computer Systems, pages 25--36, New York, NY, USA, 2004. 10.1145/1005686.1005693. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. S. M. Blackburn, R. Garner, C. Hoffmann, A. M. Khang, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo benchmarks: Java benchmarking development and analysis. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 169--190, Portland, OR, USA, 2006. 10.1145/1167473.1167488. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. T. W. Christopher. Reference count garbage collection. Software: Practice and Experience, 14 (6): 503--507, June 1984. 10.1002/spe.4380140602.Google ScholarGoogle ScholarCross RefCross Ref
  10. G. E. Collins. A method for overlapping and erasure of lists. Communications of the ACM, 3 (12): 655--657, December 1960. 10.1145/367487.367501. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. A. Demers, M. Weiser, B. Hayes, H. Boehm, D. Bobrow, and S. Shenker. Combining generational and conservative garbage collection: Framework and implementations. In Proceedings of the Seventeenth Annual ACM Symposium on the Principles of Programming Languages, pages 261--269, San Francisco, CA, USA, 1990. 10.1145/96709.96735. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. L. P. Deutsch and D. G. Bobrow. An efficient, incremental, automatic garbage collector. Communications of the ACM, 19 (9): 522--526, September 1976. 10.1145/360336.360345. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. D. Frampton. Garbage Collection and the Case for High-level Low-level Programming. PhD thesis, Australian National University, June 2010. URL http://cs.anu.edu.au/ Daniel.Frampton/DanielFrampton_Thesis_Jun2010.pdf.Google ScholarGoogle Scholar
  14. I. Jibaja, S. M. Blackburn, M. R. Haghighat, and K. S. McKinley. Deferred gratification: Engineering for high performance garbage collection from the get go. In ACM SIGPLAN Workshop on Memory Systems Performance and Correctness, pages 58--65, San Jose, CA, USA, 2011. 10.1145/1988915.1988930. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. R. E. Jones, A. Hosking, and J. E. B. Moss. The Garbage Collection Handbook: The Art of Automatic Memory Management. Chapman and Hall/CRC Applied Algorithms and Data Structures Series, USA, 2011. URL http://gchandbook.org/. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Y. Levanoni and E. Petrank. An on-the-fly reference counting garbage collector for Java. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 367--380, Tampa, FL, USA, 2001. 10.1145/504282.504309. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Y. Levanoni and E. Petrank. An on-the-fly reference-counting garbage collector for Java. ACM Transactions on Programming Languages and Systems, 28 (1): 1--69, January 2006. 10.1145/1111596.1111597. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. R. D. Lins. Cyclic reference counting with lazy mark-scan. Information Processing Letters, 44 (4): 215--220, December 1992. 10.1016/0020-0190(92)90088-D. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. A. D. Martinez, R. Wachenchauzer, and R. D. Lins. Cyclic reference counting with local mark-scan. Information Processing Letters, 34 (1): 31--35, February 1990. 10.1016/0020-0190(90)90226-N. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. J. McCarthy. Recursive functions of symbolic expressions and their computation by machine, part I. Communications of the ACM, 3 (4): 184--195, April 1960. 10.1145/367177.367199. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. H. Paz, E. Petrank, and S. M. Blackburn. Age-oriented concurrent garbage collection. In International Conference on Compiler Construction, Edinburgh, Scotland, UK, 2005. 10.1007/978--3--540--31985--6_9. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. J. Weizenbaum. Recovery of reentrant list structures in Lisp. Communications of the ACM, 12 (7): 370--372, July 1969. 10.1145/363156.363159. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Down for the count? Getting reference counting back in the ring

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in

Full Access

  • Published in

    cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 47, Issue 11
    ISMM '12
    November 2012
    136 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/2426642
    Issue’s Table of Contents
    • cover image ACM Conferences
      ISMM '12: Proceedings of the 2012 international symposium on Memory Management
      June 2012
      152 pages
      ISBN:9781450313506
      DOI:10.1145/2258996

    Copyright © 2012 ACM

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 15 June 2012

    Check for updates

    Qualifiers

    • research-article

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader
About Cookies On This Site

We use cookies to ensure that we give you the best experience on our website.

Learn more

Got it!