skip to main content
article

Space efficient conservative garbage collection

Published: 01 April 2004 Publication History

Abstract

Both type-accurate and conservative garbage collectors have gained in importance since the original paper was written. Managing unnecessary retention by conservative collectors continues to be an important problem. There appear to be few reimplementations of the techniques we described, but significantly refined descendents of the original implementation are alive and well inside a large number of applications.There has been later work both on quantifying space retention by conservative collectors, and on theoretical bounds for such retention.We call a garbage collector conservative if it has only partial information about the location of pointers, and is thus forced to treat arbitrary bit patterns as though they might be pointers, in at least some cases. We show that some very inexpensive, but previously unused techniques can have dramatic impact on the effectiveness of conservative garbage collectors in reclaiming memory. Our most significant observation is that static data that appears to point to the heap should not result in misidentified references to the heap. The garbage collector has enough information to allocate around such references. We also observe that programming style has a significant impact on the amount of spuriously retained storage, typically even if the collector is not terribly conservative. Some fairly common C and C++ programming styles significantly decrease the effectiveness of any garbage collector. These observations suffice to explain some of the different assessments of conservative collection that have appeared in the literature.

References

[1]
Hans-J. Boehm. A garbage collector for C and C++. http://www.hpl.hp.com/personal/Hans_Boehm/gc/.
[2]
Hans-J. Boehm. Fast multiprocessor memory allocation and garbage collection. Technical Report HPL-2000-165, HP Laboratories, December 2000.
[3]
Hans-J. Boehm. Reducing garbage collector cache misses. In Proceedings of the 2000 International Symposium on Memory Management, pages 59--64, 2000.
[4]
Hans-J. Boehm. Bounding space usage of conservative garbage collectors. In Proceedings of the Twenty-Ninth Annual ACM Symposium on Principles of Programming Languages, pages 93--100, 2002.
[5]
William D. Clinger. Proper tail recursion and space efficiency. In SIGPLAN '98 Conference on Programming Language Design and Implementation, pages 174--185, June 1998.
[6]
Martin Hirzel and Amer Diwan. On the type accuracy of garbage collection. In Proceedings of the International Symposium on Memory Management 2000, pages 1--11, October 2000.
[7]
Allen Leung. Prop: AC++ -based pattern matching language. http://cs1.cs.nyu.edu/leunga/www/papers/research/prop/prop.html, 1996.
[8]
Palo Alto Research Center, Incorporated. Parc history. http://www.parc.com/company/history.
[9]
Gustavo Rodriguez-Rivera, Mike Spertus, and Charles Fiterman. Conservative garbage collection for general memory allocators. In Proceedings of the International Symposium on Memory Management 2000, pages 71--79, October 2000.
[10]
Manuel Serrano and Hans-J. Boehm. Understanding memory allocation of Scheme programs. In Proceedings of the 2000 International Conference on Functional Programming (ICFP), pages 245--256, 2000.
[11]
Geodesic Systems. Geodesic systems - amazon.com customer story. http://www.geodesic.com/about/customers/amazon_story.html, 2002.
[12]
Geodesic Systems. Geodesic systems - runtime analyzer. http://www.geodesic.com/solutions/products_analyzer.html, 2002.
[13]
E. P. Wentworth. Pitfalls of conservative garbage collection. Software Practice and Experience, 20(7):719--727, 1990.
[14]
Standard X3.159-1989, American National Standard for Information Systems - Programming Language - C, American National Standards Institute, Inc.
[15]
Atkinson, Russ, Alan Demers, Carl Hauser, Christian Jacobi, Peter Kessler, and Mark Weiser, "Experiences Creating a Portable Cedar", Proceedings of the ACM SIGPLAN '89 Conference on Programming Language Design and Implementation, SIGPLAN Notices 24, 7 (July 1989), pp. 322--329.
[16]
Bartlett, Joel F. "Compacting garbage collection with ambiguous roots", Lisp Pointers 1, 6 (April-June 1988), pp. 3--12.
[17]
Bartlett, Joel F., Scheme → C a Portable Scheme-to-C Compiler, WRL Research Report 89/1, Digital Equipment Corporation Western Research Laboratory, January 1989.
[18]
Bartlett, Joel F., Mostly Copying Garbage Collection Picks Up Generations and C++, Technical Report TN-12, Digital Equipment Corporation Western Research Laboratory, October 1989.
[19]
Bekkers, Y., O. Ridoux, and L. Ungaro, "Dynamic Memory Management for Sequential Logic Programming Languages, Proceedings of the International Workshop on Memory Management, St. Malo, France, September 1992, Springer LNCS 637, pp. 82--102.
[20]
Boehm, Hans-J., and David Chase, "A Proposal for Garbage-Collector-Safe C Compilation", The Journal of C Language Translation 4, 2 (December 1992), pp. 126--141.
[21]
Boehm, H., A. Demers, and S. Shenker, "Mostly Parallel Garbage Collection", Proceedings of the ACM SIGPLAN '91 Conference on Programming Language Design and Implementation, SIGPLAN Notices 26, 6 (June 1991), pp. 157--164.
[22]
Boehm, Hans-J. and Mark Weiser, "Garbage collection in an uncooperative environment", Software Practice & Experience 18, 9 (Sept. 1988), pp. 807--820.
[23]
Chailloux, Emmanuel, "A Conservative Garbage Collector with Ambiguous Roots for Static Type-checking Languages", Proceedings of the International Workshop on Memory Management, St. Malo, France, September 1992, Springer LNCS 637, pp. 218--229.
[24]
Cridlig, Regis, "An Optimizing ML to C Compiler", ACM SIGPLAN Workshop on ML and its Applications, San Francisco, June 1992, David MacQueen, chair.
[25]
A. Demers, M. Weiser, B. Hayes, H. Boehm, D. Bobrow, S. Shenker, "Combining Generational and Conservative Garbage Collection: Framework and Implementations", Proceedings of the Seventeenth Annual ACM Symposium on Principles of Programming Languages, January 1990, pp. 261--269.
[26]
Detlefs, David L., "Concurrent Garbage Collection for C++", in Advanced Programming Language Implementation, Peter Lee, ed., MIT Press, 1991.
[27]
Edelson, Daniel, "A Mark-and-Sweep Collector for C++", Conference Record of the Nineteenth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Albuquerque, New Mexico, January 1992, pp. 51--58.
[28]
Goldberg, Benjamin, and Michael Gloger, "Polymorphic Type Reconstruction for Garbage Collection without Tags", Proceedings of the 1992 ACM Conference on Lisp and Functional Programming, pp. 53--65.
[29]
Hastings, Reed, and Bob Joyce, "Fast Detection of Memory Leaks and Access Errors", Proceedings of the Winter '92 USENIX conference, pp. 125--136.
[30]
Omohundro, Stephen M., The Sather Language, ICSI, Berkeley, 1991.
[31]
Rose, John R., and Hans Muller, "Integrating the Scheme and C languages", Proceedings of the 1992 ACM Conference on Lisp and Functional Programming, pp. 247--259.
[32]
Rovner, Paul, "On Adding Garbage Collection and Runtime Types to a Strongly-Typed Statically Checked, Concurrent Language", Technical Report CSL-84-7, Xerox Palo Alto Research Center, Palo Alto, CA, July 1985.
[33]
Ungar, David M., "Generation Scavenging: A Non-Distruptive High Performance Storage Reclamation Algorithm", ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments, SIGPLAN Notices 19, 5 (May 1984), pp. 157--167.
[34]
Schelter, W. F., and M. Ballantyne, "Kyoto Common Lisp", AI Expert 3 3 (1988), pp. 75--77.
[35]
Weiser, Mark, Alan Demers, and Carl Hauser, "The Portable Common Runtime Approach to Interoperability", Proceedings 13th ACM Symposium on Operating Systems Principles, December 1989.
[36]
Wentworth, E. P., "Pitfalls of Conservative Garbage Collection", Software Practice & Experience 20, 7 (July 1990) pp. 719--727.
[37]
Wilson, Paul R., "Uniprocessor Garbage Collection Techniques", Proceedings of the International Workshop on Memory Management, St. Malo, France, September 1992, Springer LNCS 637, pp. 1--42.
[38]
Zorn, Benjamin, "The Measured Cost of Conservative Garbage Collection", University of Colorado at Boulder, Department of Computer Science Technical Report CU-CS-573-92.

Cited By

View all
  • (2020)Sound garbage collection for C using pointer provenanceProceedings of the ACM on Programming Languages10.1145/34282444:OOPSLA(1-28)Online publication date: 13-Nov-2020
  • (2017)ForkscanProceedings of the Twelfth European Conference on Computer Systems10.1145/3064176.3064214(483-498)Online publication date: 23-Apr-2017
  • (2014)Automated memory leak detection for production useProceedings of the 36th International Conference on Software Engineering10.1145/2568225.2568311(825-836)Online publication date: 31-May-2014
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 39, Issue 4
20 Years of the ACM SIGPLAN Conference on Programming Language Design and Implementation 1979-1999: A Selection
April 2004
673 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/989393
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 April 2004
Published in SIGPLAN Volume 39, Issue 4

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)2
  • Downloads (Last 6 weeks)0
Reflects downloads up to 10 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2020)Sound garbage collection for C using pointer provenanceProceedings of the ACM on Programming Languages10.1145/34282444:OOPSLA(1-28)Online publication date: 13-Nov-2020
  • (2017)ForkscanProceedings of the Twelfth European Conference on Computer Systems10.1145/3064176.3064214(483-498)Online publication date: 23-Apr-2017
  • (2014)Automated memory leak detection for production useProceedings of the 36th International Conference on Software Engineering10.1145/2568225.2568311(825-836)Online publication date: 31-May-2014
  • (2014)Detecting memory leaks through introspective dynamic behavior modelling using machine learningProceedings of the 36th International Conference on Software Engineering10.1145/2568225.2568307(814-824)Online publication date: 31-May-2014
  • (2013)Consistent, durable, and safe memory management for byte-addressable non volatile main memoryProceedings of the First ACM SIGOPS Conference on Timely Results in Operating Systems10.1145/2524211.2524216(1-17)Online publication date: 3-Nov-2013

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media