Finalization in the collector interface

  • Barry Hayes
Object Oriented Languages
Part of the Lecture Notes in Computer Science book series (LNCS, volume 637)


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.


Soft Pointer Garbage Collection Finalizable Object Memory Object Garbage Collector 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [AAB+91]
    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.Google Scholar
  2. [ADH+89]
    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.Google Scholar
  3. [AN88]
    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.Google Scholar
  4. [AP87]
    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.Google Scholar
  5. [Atk89]
    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.Google Scholar
  6. [Bar89]
    Joel F. Bartlett. Mostly-copying garbage collection picks up generations and C++. Technical report, Digital Western Reseaerch Laboratory, October 1989.Google Scholar
  7. [Boe91]
    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 in pub/garbage/GC91.Google Scholar
  8. [BW88]
    Hans-J. Boehm and M. Weiser. Garbage collection in an uncooperative environment. Software Practice and Experience, 18(9):807–820, September 1988.Google Scholar
  9. [Cha87]
    David R. Chase. Garbage Collection and Other Optimizations. PhD thesis, Rice University, November 1987.Google Scholar
  10. [DoD91a]
    Department of Defense. Mapping Rational, volume I of Ada 9X Mapping. Intermetrics, Inc., Cambridge, Massachusetts, August 1991.Google Scholar
  11. [DoD91b]
    Department of Defense. Mapping Specification, volume II of Ada 9X Mapping. Intermetrics, Inc., Cambridge, Massachusetts, August 1991.Google Scholar
  12. [Det91]
    David L. Detlefs. Concurrent garbage collection for C++. Technical Report CMU-CS-90-119, Carnegie-Mellon University, 1991.Google Scholar
  13. [Ede90]
    D. Edelson. Dynamic storage reclamation in C++. Technical Report UCSC-CRL-90-19, University of California at Santa Cruz, June 1990.Google Scholar
  14. [ES90]
    Margaret A. Ellis and Bjarne Stroustrup. The Annotated C++ Reference Manual. Addison-Wesley Publishing Company, Reading, Mass, 1990.Google Scholar
  15. [Hud91]
    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 in pub/garbage/GC91.Google Scholar
  16. [LHL+77]
    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.Google Scholar
  17. [NLT+86]
    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.Google Scholar
  18. [Nyb89]
    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].Google Scholar
  19. [Par90]
    ParcPlace Systems. Object Works/Smalltalk User's Guide, Release 4. ParcPlace Systems, Inc, Mountain View, CA, 1990.Google Scholar
  20. [RAM84]
    Jonathan A. Rees, Norman I. Adams, and James R. Meechan. The T manual. Technical report, Yale University, January 1984.Google Scholar
  21. [Rov85]
    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.Google Scholar
  22. [SMS81]
    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.Google Scholar
  23. [Sun90]
    Sun Microsystems. Ne WS 2.1 Programmer's Guide. Sun Microsystems, Inc, Mountain View, CA, 1990.Google Scholar
  24. [Xer85]
    Xerox Corporation. Interlist Reference Manual, volume 1. Xerox Corporation, Palo Alto, CA, October 1985.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1992

Authors and Affiliations

  • Barry Hayes
    • 1
  1. 1.Department of Computer ScienceStanford UniversityStanfordUSA

Personalised recommendations