Skip to main content

The Implementer’s Dilemma: A Mathematical Model of Compile Time Garbage Collection

  • Chapter
  • 54 Accesses

Part of the book series: Workshops in Computing ((WORKSHOPS COMP.))

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. A.W. Appel. Garbage collection can be faster than stack allocation. Information Processing Letters, 25(4):275–279, June 1987.

    Article  Google Scholar 

  2. J. Heyman. A comprehensive analytical model for garbage collection algorithms. ACM SIGPLAN Notices, 26(8), August 1991.

    Google Scholar 

  3. 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.

    Google Scholar 

  4. 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.

    Google Scholar 

  5. 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.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics