Abstract
When a tracing garbage collector operates, it treats the objects and pointers in the system as nodes and edges in a directed graph. Most collectors simply use the graph to seek out objects that have become unreachable from the root objects and recycle the storage associated with them.
A few collector designers have hit on the idea of using the trace to gather other information about the connectivity of the graph, and notify user-level code when an object is reachable from the roots, but only in a restricted way. The user-level code typically uses this information to perform some final action on the object, and then destroys even the restricted access to the object, allowing the next pass of the garbage collector to recycle the storage. Finalization is useful for appropriating the power of garbage collection to manage non-memory resources. The resource in question can be embodied in a memory object with finalization enabled. When the memory resource is reachable only through restricted paths, the non-memory resource can be recycled and the restricted access destroyed. The users of the resource need not coordinate to manage, nor do they need to know that the resource is precious or needs finalization.
This paper presents system-level details of five different implementations of finalization in five different systems, and language-level details of several languages that have defined similar mechanisms. These comparisons highlight several areas of concern when designing a system with finalization.
Preview
Unable to display preview. Download preview PDF.
References
H. Abelson, N. I. Adams IV, D. H. Bartley, G. Brooks, Dybvig R. K., D. P. Friedman, R. Halstead, C. Hanson, C. T. Haynes, E. Kohlbecker, D. Oxley, K. M. Pitman, G. J. Rozas, G. L. Steel Jr., G. J. Sussman, and M. Wand. Revised4 report on the algorithmic language Scheme. ACM LISP Pointers, IV(3), November 1991.
R. Atkinson, Alan Demers, Carl Hauser, Christian Jacobi, Peter Kessler, and Mark Weiser. Experiences creating a portable Cedar. SIGPLAN Notices, 24(7):261–269, July 1989.
Martin C. Atkins and Lee R. Nackman. The active deallocation of objecs in object-oriented systems. Software Practice and Experience, 18(11):1073–1089, November 1988.
S. G. Abraham and J. H. Patel. Parallel garbage collection on a virtual memory system. In 14th Annual international symposium on computer architecture, page 26, June 1987.
Martin C. Atkins. Implementation Techniques for Object-Oriented Systems. PhD thesis, University of York, Dept. Computer Science, University of York, Heslington, York, YO1 5DD, England., 1989.
Joel F. Bartlett. Mostly-copying garbage collection picks up generations and C++. Technical report, Digital Western Reseaerch Laboratory, October 1989.
Hans-J. Boehm. Simple gc-safe compilation. In OOPSLA Workshop on Garbage Collection in Object-Oriented Systems, 1992, October 1991. Available by anonymous ftp from cs.utexas.edu in pub/garbage/GC91.
Hans-J. Boehm and M. Weiser. Garbage collection in an uncooperative environment. Software Practice and Experience, 18(9):807–820, September 1988.
David R. Chase. Garbage Collection and Other Optimizations. PhD thesis, Rice University, November 1987.
Department of Defense. Mapping Rational, volume I of Ada 9X Mapping. Intermetrics, Inc., Cambridge, Massachusetts, August 1991.
Department of Defense. Mapping Specification, volume II of Ada 9X Mapping. Intermetrics, Inc., Cambridge, Massachusetts, August 1991.
David L. Detlefs. Concurrent garbage collection for C++. Technical Report CMU-CS-90-119, Carnegie-Mellon University, 1991.
D. Edelson. Dynamic storage reclamation in C++. Technical Report UCSC-CRL-90-19, University of California at Santa Cruz, June 1990.
Margaret A. Ellis and Bjarne Stroustrup. The Annotated C++ Reference Manual. Addison-Wesley Publishing Company, Reading, Mass, 1990.
Richard L. Hudson. Finalization in a garbage collected world. In OOPSLA Workshop on Garbage Collection in Object-Oriented Systems, 1992, October 1991. Available by anonymous ftp from cs.utexas.edu in pub/garbage/GC91.
B. W. Lampson, J. J. Horning, R. L. London, J. G. Mitchell, and G. J. Popek. Report on the programming language euclid. SIGPLAN Notices, February 1977.
Lee R. Nackman, Mark A Lavin, Russell H. Taylor, Walter C. Dietrich, Jr., and David D. Grossman. AML/X: a programming language for design and manufacturing. In Proceedings of the Fall Joint Computer Conference, pages 145–159, November 1986.
Karl A. Nyberg, editor. The Annotated Ada Reference Manual. Grebyn Corporation, Vienna, Virginia, 1989. [An annotated version of ANSI/MIL-STD-1815A-1983, The Ada Reference Manual].
ParcPlace Systems. Object Works/Smalltalk User's Guide, Release 4. ParcPlace Systems, Inc, Mountain View, CA, 1990.
Jonathan A. Rees, Norman I. Adams, and James R. Meechan. The T manual. Technical report, Yale University, January 1984.
Paul Rovner. On adding garbage collection and runtime types to a stronglytyped, staticly-checked, concurrent language. Technical Report CSL-84-7, Xerox Corporation, July 1985.
Richard L. Schwartz and P. M. Melliar-Smith. The finalization operation for abstract types. In Proceedings of the 5th International Conference on Software Engineering, pages 273–282, San Diego, California, March 1981.
Sun Microsystems. Ne WS 2.1 Programmer's Guide. Sun Microsystems, Inc, Mountain View, CA, 1990.
Xerox Corporation. Interlist Reference Manual, volume 1. Xerox Corporation, Palo Alto, CA, October 1985.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1992 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Hayes, B. (1992). Finalization in the collector interface. In: Bekkers, Y., Cohen, J. (eds) Memory Management. IWMM 1992. Lecture Notes in Computer Science, vol 637. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0017196
Download citation
DOI: https://doi.org/10.1007/BFb0017196
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-55940-5
Online ISBN: 978-3-540-47315-2
eBook Packages: Springer Book Archive