Abstract
Optimization by compile time garbage collection is one possible weapon in the functional language implementer’s armoury for combatting the excessive memory allocation usually exhibited by functional programs. It is an interesting idea, but the practical question of whether it yields benefits in practice has still not been answered convincingly one way or the other.
In this short paper we present a mathematical model of the performance of straightforward versions of mark-scan and copying garbage collectors with programs optimized for explicit deallocation. A mark-scan heap manager has a free list, whereas a copying heap manager does not — herein lies the dilemma, since a copying garbage collector is usually considered to be faster than a mark-scan, but it cannot take advantage of this important optimization.
For tract ability we consider only heaps with fixed cells. The results reported show that the garbage collection scheme of choice depends quite strongly on the heap occupancy ratio: the proportion of the total heap occupied by accessible data structures averaged over the execution of the program. We do not know what typical heap occupancy ratios are, and so are unable to make specific recommendations, but the results may be of use in tailoring applications and heap management schemes, or in controlling schemes where the heap size varies dynamically.
An important result arising from the work reported here is that when optimizing for explicit deallocation, a very large proportion of cell releases must be optimized before very much performance benefit is obtained.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
A.W. Appel. Garbage collection can be faster than stack allocation. Information Processing Letters, 25(4):275–279, June 1987.
J. Heyman. A comprehensive analytical model for garbage collection algorithms. ACM SIGPLAN Notices, 26(8), August 1991.
S.B. Jones and D. Le Métayer. Compile-time garbage collection by sharing analysis. In Proceedings of the Fourth International Conference on Functional Programming Languages and Computer Architecture, pages 54–74, 1989.
P. Sansom. Combining copying and compacting garbage collection. In R. Heldal, C.K. Hoist, and P. Wadler, editors, 1991 Glasgow Workshop on Functional Programming. Springer-Verlag, Workshops in Computing, August 1991.
A.S. Tyas. An investigation into the optimization of garbage collection within functional languages. Final Year Dissertation, Department of Computing Science and Mathematics, University of Stirling, April 1993.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1994 British Computer Society
About this chapter
Cite this chapter
Jones, S.B., Tyas, A.S. (1994). The Implementer’s Dilemma: A Mathematical Model of Compile Time Garbage Collection. In: O’Donnell, J.T., Hammond, K. (eds) Functional Programming, Glasgow 1993. Workshops in Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3236-3_11
Download citation
DOI: https://doi.org/10.1007/978-1-4471-3236-3_11
Publisher Name: Springer, London
Print ISBN: 978-3-540-19879-6
Online ISBN: 978-1-4471-3236-3
eBook Packages: Springer Book Archive