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.
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- T. W. Christopher. Reference count garbage collection. Software: Practice and Experience, 14 (6): 503--507, June 1984. 10.1002/spe.4380140602.Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- J. Weizenbaum. Recovery of reentrant list structures in Lisp. Communications of the ACM, 12 (7): 370--372, July 1969. 10.1145/363156.363159. Google Scholar
Digital Library
Index Terms
Down for the count? Getting reference counting back in the ring
Recommendations
Down for the count? Getting reference counting back in the ring
ISMM '12: Proceedings of the 2012 international symposium on Memory ManagementReference 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 ...
Ulterior reference counting: fast garbage collection without a long wait
OOPSLA '03: Proceedings of the 18th annual ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applicationsGeneral purpose garbage collectors have yet to combine short pause times with high throughput. For example, generational collectors can achieve high throughput. They have modest average pause times, but occasionally collect the whole heap and ...
Ulterior reference counting: fast garbage collection without a long wait
Special Issue: Proceedings of the OOPSLA '03 conferenceGeneral purpose garbage collectors have yet to combine short pause times with high throughput. For example, generational collectors can achieve high throughput. They have modest average pause times, but occasionally collect the whole heap and ...







Comments