skip to main content
research-article

Fast conservative garbage collection

Published:15 October 2014Publication History
Skip Abstract Section

Abstract

Garbage collectors are exact or conservative. An exact collector identifies all references precisely and may move referents and update references, whereas a conservative collector treats one or more of stack, register, and heap references as ambiguous. Ambiguous references constrain collectors in two ways. (1) Since they may be pointers, the collectors must retain referents. (2) Since they may be values, the collectors cannot modify them, pinning their referents.

We explore conservative collectors for managed languages, with ambiguous stacks and registers. We show that for Java benchmarks they retain and pin remarkably few heap objects: < 0.01% are falsely retained and 0.03% are pinned. The larger effect is collector design. Prior conservative collectors (1) use mark-sweep and unnecessarily forgo moving all objects, or (2) use mostly copying and pin entire pages. Compared to generational collection, overheads are substantial: 12% and 45% respectively. We introduce high performance conservative Immix and reference counting (RC). Immix is a mark-region collector with fine line-grain pinning and opportunistic copying of unambiguous referents. Deferred RC simply needs an object map to deliver the first conservative RC. We implement six exact collectors and their conservative counterparts. Conservative Immix and RC come within 2 to 3% of their exact counterparts. In particular, conservative RC Immix is slightly faster than a well-tuned exact generational collector. These findings show that for managed languages, conservative collection is compatible with high performance.

References

  1. O. Agesen, D. Detlefs, and J. E. Moss. Garbage collection and local variable type-precision and liveness in java virtual machines. In Proceedings of the ACM SIGPLAN 1998 Conference on Programming Language Design and Implementation, PLDI '98, pages 269--279, New York, NY, USA, 1998. ACM. doi: 10.1145/277650.277738. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. B. Alpern, S. Augart, S. M. Blackburn, M. Butrico, A. Cocchi, P. Cheng, J. Dolby, S. J. Fink, D. Grove, M. Hind, K. S. McKinley, M. Mergen, J. E. B. Moss, T. Ngo, V. Sarkar, and M. Trapp. The Jikes RVM Project: Building an open source research community. IBM System Journal, 44 (2): 399--418, 2005. doi: 10.1147/sj.442.0399. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Apple Inc. Transitioning to ARC release notes, Aug. 2013. URL https://developer.apple.com/library/mac/releasenotes/ObjectiveC/RN-TransitioningToARC.Google ScholarGoogle Scholar
  4. Apple Inc. The Swift Programming Language. Swift Programming Series. Apple Inc., June 2014.Google ScholarGoogle Scholar
  5. G. Attardi and T. Flagella. A customisable memory management framework. In Proceedings of the 6th Conference on USENIX Sixth C++ Technical Conference - Volume 6, CTEC'94, pages 8--8, Berkeley, CA, USA, 1994. USENIX Association. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. D. F. Bacon and V. T. Rajan. Concurrent cycle collection in reference counted systems. In European Conference on Object-Oriented Programming, Budapest, Hungary, June 18 - 22, 2001, pages 207--235. LNCS, 2001. ISBN 3-540-42206-4. doi: 10.1007/3-540-45337-7_12. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. J. Baker, A. Cunei, T. Kalibera, F. Pizlo, and J. Vitek. Accurate garbage collection in uncooperative environments revisited. Concurrency and Computation: Practice and Experience, 21 (12): 1572--1606, 2009. doi: 10.1002/cpe.1391. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. J. F. Bartlett. Compacting garbage collection with ambiguous roots. SIGPLAN Lisp Pointers, 1 (6): 3--12, Apr. 1988. ISSN 1045-3563. doi: 10.1145/1317224.1317225. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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, PLDI'08, Tucson, AZ, USA, June 2008, pages 22--32. ACM, 2008. doi: 10.1145/1379022.1375586. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. S. M. Blackburn, P. Cheng, and K. S. McKinley. Oil and water? High performance garbage collection in Java with MMTk. In The 26th International Conference on Software Engineering, ICSE'04, Edinburgh, Scotland, 2004, pages 137--146. ACM/IEEE, 2004 doi: 10.1109/ICSE.2004.1317436. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. S. M. Blackburn, P. Cheng, and K. S. McKinley. Myths and realities: The performance impact of garbage collection. In SIGMETRICS - Performance 2004, Joint International Conference on Measurement and Modeling of Computer Systems, New York, NY, USA, June 12-16, 2004, pages 25--36. ACM, 2004. doi: 10.1145/1005686.1005693. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. S. M. Blackburn, M. Hirzel, R. Garner, and D. Stefanović. pjbb2005: The pseudojbb benchmark, 2005. URL http://users.cecs.anu.edu.au/~steveb/research/research-infrastructure/pjbb2005.Google ScholarGoogle Scholar
  13. S. M. Blackburn, R. Garner, C. Hoffmann, A. M. Khan, 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, OOPSLA'06, Portland, OR, USA, Oct, 2006, pages 169--190. ACM, 2006. doi: 10.1145/1167473.1167488. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. M. Blackburn, K. S. McKinley, R. Garner, C. Hoffman, A. M. Khan, 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. Wake Up and Smell the Coffee: Evaluation Methodology for the 21st Century. Commun. ACM, 51 (8): 83--89, Aug. 2008. dopi: 10.1145/1378704.1378723. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. H.-J. Boehm and M. Weiser. Garbage collection in an uncooperative environment. Software Practice and Experience, 18 (9): 807--820, Sept. 1988. ISSN 0038-0644. doi: 10.1002/spe.4380180902. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. T. Cao, S. M. Blackburn, T. Gao, and K. S. McKinley. The yin and yang of power and performance for asymmetric hardware and managed software. In The 39th International Conference on Computer Architecture, ISCA'12, Portland, OR, June, 2012, pages 225--236. ACM/IEEE, 2012. doi: 10.1145/2366231.2337185. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. T. W. Christopher. Reference count garbage collection. Software Practice and Experience, 14 (6): 503--507, June 1984. doi: 10.1002/spe.4380140602.Google ScholarGoogle ScholarCross RefCross Ref
  18. G. E. Collins. A method for overlapping and erasure of lists. Commun. ACM, 3 (12): 655--657, December 1960. doi: 10.1145/367487.367501. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. A. Demers, M. Weiser, B. Hayes, H. Boehm, D. Bobrow, and S. Shenker. Combining generational and conservative garbage collection: framework and implementations. In ACM Symposium on the Principles of Programming Languages, POPL'90, San Francisco, CA, USA, pages 261--269. ACM, 1990. doi: 10.1145/96709.96735. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. L. P. Deutsch and D. G. Bobrow. An efficient, incremental, automatic garbage collector. Commun. ACM, 19 (9): 522--526, September 1976. doi: 10.1145/360336.360345. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. A. Diwan, E. Moss, and R. Hudson. Compiler support for garbage collection in a statically typed language. In Proceedings of the ACM SIGPLAN 1992 Conference on Programming Language Design and Implementation, PLDI '92, pages 273--282, New York, NY, USA, 1992. ACM. doi: 10.1145/143095.143140. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. 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
  23. F. Henderson. Accurate garbage collection in an uncooperative environment. In Proceedings of the 3rd International Symposium on Memory Management, ISMM 2002, Berlin, Germany, June 20 - 21, 2002, pages 150--156. ACM, 2002. ISBN 1-58113-539-4. doi: 10.1145/512429.512449. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. M. Hirzel, A. Diwan, and J. Henkel. On the usefulness of type and liveness accuracy for garbage collection and leak detection. ACM Trans. Program. Lang. Syst., 24 (6): 593--624, Nov. 2002. ISSN 0164-0925. doi: 10.1145/586088.586089. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. A. L. Hosking. Portable, mostly-concurrent, mostly-copying garbage collection for multi-processors. In Proceedings of the 5th International Symposium on Memory Management, ISMM 2006, Ottawa, Canada, June 10 - 11, 2006, pages 40--51. ACM, 2006. ISBN 1-59593-221-6. doi: 10.1145/1133956.1133963. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. R. D. Lins. Cyclic reference counting with lazy mark-scan. Inf. Process. Lett., 44 (4): 215--220, 1992. doi: 10.1016/0020-0190(92)90088-D. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. LLVM. Accurate garbage collection with LLVM, Feb. 2014. URL http://llvm.org/docs/GarbageCollection.html.Google ScholarGoogle Scholar
  28. J. McCarthy. Recursive functions of symbolic expressions and their computation by machine, part I. Commun. ACM, 3 (4): 184--195, April 1960. doi: 10.1145/367177.367199. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Y. Seeley. JIRA issue LUCENE-1800: QueryParser should use reusable token streams, 2009. URL https://issues.apache.org/jira/browse/LUCENE-1800.Google ScholarGoogle Scholar
  30. R. Shahriyar, S. M. Blackburn, and D. Frampton. Down for the count? Getting reference counting back in the ring. In Proceedings of the 11th International Symposium on Memory Management, ISMM 2012, Beijing, China, June 15 - 16, 2012, pages 73--84. ACM, 2012. doi: 10.1145/2258996.2259008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. R. Shahriyar, S. M. Blackburn, X. Yang, and K. S. McKinley. Taking off the gloves with reference counting Immix. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA'13, Indianapolis, Indiana, USA, Oct, 2013, pages 93--110. ACM, 2013. doi: 10.1145/2509136.2509527. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. F. Smith and G. Morrisett. Comparing mostly-copying and mark-sweep conservative collection. In Proceedings of the 1st International Symposium on Memory Management, ISMM 1998, Vancouver, BC, Canada, October 17 - 19, 1998, pages 68--78. ACM, 1998. ISBN 1-58113-114-3. doi: 10.1145/301589.286868. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. SPEC. SPECjvm98, Release 1.03. Standard Performance Evaluation Corporation, Mar. 1999. URL http://www.spec.org/jvm98.Google ScholarGoogle Scholar
  34. SPEC. SPECjbb2005 (Java Server Benchmark), Release 1.07. Standard Performance Evaluation Corporation, 2006. URL http://www.spec.org/jbb2005.Google ScholarGoogle Scholar
  35. L. D. Stein. Devel::Cycle - Find memory cycles in objects, 2003. URL http://search.cpan.org/~lds/Devel-Cycle-1.11/lib/Devel/Cycle.pm.Google ScholarGoogle Scholar
  36. J. R. Thomas, M. Cantu, and A. Bauer. Reference counting and object harvesting in Delphi. Dr. Dobb's, May 2013. URL http://www.drdobbs.com/mobile/reference-counting-and-object-harvesting/240155664.Google ScholarGoogle Scholar
  37. WebKit. The WebKit open source project, 2014. URL http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/heap.Google ScholarGoogle Scholar
  38. X. Yang, S. M. Blackburn, D. Frampton, J. B. Sartor, and K. S. McKinley. Why nothing matters: The impact of zeroing. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA'11, Portland, Oregon, USA, Oct, 2011, pages 307--324. ACM, 2011. doi: 10.1145/2048066.2048092. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. X. Yang, S. M. Blackburn, D. Frampton, and A. L. Hosking. Barriers reconsidered, friendlier still! In Proceedings of the 11th International Symposium on Memory Management, ISMM 2012, Beijing, China, June 15 - 16, 2012, pages 37--48. ACM, 2012. doi: 10.1145/2258996.2259004. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Fast conservative garbage collection

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 49, Issue 10
    OOPSLA '14
    October 2014
    907 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/2714064
    • Editor:
    • Andy Gill
    Issue’s Table of Contents
    • cover image ACM Conferences
      OOPSLA '14: Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications
      October 2014
      946 pages
      ISBN:9781450325851
      DOI:10.1145/2660193

    Copyright © 2014 ACM

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 15 October 2014

    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!