Abstract
Although the LISP community have been exploiting the fruits of generational garbage collection for some time, little attempt has been made to apply these ideas in lazy functional language implementations. This paper attempts to plug that gap.
The action of overwriting an unevaluated thunk with its final value, known as updating, is central to lazy reduction systems. Unfortunately, updating creates pointers from older to younger generations. A simple two-generation scheme which allows heap occupancy to approach 100% is presented. This collector is a hybrid semispace and mark-scan collector. We show that keeping track of old-to-new pointers imposes virtually zero time and space overhead on the mutator. Consequently a net performance gain can be had by using generational collection.
This paper describes how a generational collector was incorporated into a standard G-machine interpreter. Detailed performance measurements presented indicate that a significant improvement in overall performance is achieved, compared to both semispace and compacting mark-scan collectors. Some interesting variants of the basic scheme are discussed. Finally, a possible compiled-code implementation is presented.
Preview
Unable to display preview. Download preview PDF.
Bibliography
Andrew W. Appel. Compiling with Continuations. Cambridge University Press, 1992.
L. Augustsson. A compiler for lazy ML. In Proceedings of the 1984 ACM Symposium on Lisp and Functional Programming, pages 218–227, Austin, Texas, August 1984.
C. J. Cheney. A nonrecursive list compacting algorithm. Communications of the ACM, 13:677–678, November 1970.
T. Johnsson. Compiling Lazy Functional Languages. PhD thesis, Chalmers Tekniska Högskola, Göteborg, Sweden, 1987.
H. B. M. Jonkers. A fast garbage compaction algorithm. Information Processing Letters, 9:26–30, July 1979.
S.L. Peyton Jones. The Implementation of Functional Programming Languages. Prentice-Hall International Series in Computer Science. Prentice-Hall International (UK) Ltd, London, 1987.
S.L. Peyton Jones. The spineless tagless g-machine: second attempt. Publication forthcoming, 1991.
Patrick M. Sansom. Dual-mode garbage collection. In Proceedings of the 1991 Glasgow Functional Programming Workshop, 1991.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1992 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Seward, J. (1992). Generational garbage collection for lazy graph reduction. 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/BFb0017191
Download citation
DOI: https://doi.org/10.1007/BFb0017191
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