Mark DURING sweep rather than mark THEN sweep
Garbage Collection frees the programmer from the burden of explicitly deallocating unused data. This facility induces a considerable overhead but also causes some delays that may affect real-time applications. Guaranteed throughput (with at most short and predictable delays) is needed in many applications such as plane or plant control and requires at least a worst case analysis to identify the performances of the whole system. Traditional GC are made of two phases : the marker which identifies all useful data, followed by the sweeper which reclaims all useless data. On-the-fly GC schemes were introduced to permit an application and a collector to run concurrently. That concurrency may lessen the GC penalty incurred by the application.
We present here a new algorithm where the application, the marker and the sweeper are concurrent. The benefit is to tightly adjust collection rate to application consumption and have an allocation time bounded by a small constant. Moreover our algorithm does not waste memory and appears to be well suited for embedded systems.
This “mark DURING sweep” algorithm is completely presented. An interesting single-processor and incremental realisation is also analysed and followed by some implementation variations.
KeywordsGarbage Collection Garbage Collector Grey Cell Black Cell Guarantee Throughput
Unable to display preview. Download preview PDF.
- [Appel 87]
- [Appel & Ellis & Li 88]Andrew W. Appel, John R. Ellis, Kai Li, Real-time Concurrent Collection on Stock Multiprocessors, Proceedings of the SIGPLAN'88 Conference on Programming Language Design and Implementation, Atlanta, Georgia, June 22–24, 1988, pp 11–20.Google Scholar
- [Baker 78]
- [Ben-Ari 84]
- [Bobrow 79]
- [Brinch Hansen 73]Brinch Hansen, Operating System Principles, Prentice-Hall, Englewood Cliffs, New Jersey, 1973.Google Scholar
- [Cohen 81]
- [Derbyshire 88]Margaret H. Derbyshire, Mark Scan Garbage Collection On A Distributed Architecture submitted to Lisp And Symbolic Computation.Google Scholar
- [Dijkstra 78]
- [Fenichel & Yochelson 69]R.R. Fenichel, J.C. Yochelson, A Lisp Garbage Collector for Virtual-Memory Computer Systems, Communications of ACM, Vol. 12, No 11, November 1969.Google Scholar
- [Goldberg 83]Adele Goldberg and David Robson, Smalltalk-80 The Language and its Implementation, Addison-Wesley, 1983.Google Scholar
- [Hudak & Keller 82]P. Hudak and R. Keller, Garbage Collection and Task Deletion in Distributed Applicative Processing Systems, ACM Symposium on Lisp and Functional Programming, August 1982.Google Scholar
- [Hughes 85]John Hughes, A Distributed Garbage Collection, Lecture Notes on Computer Science, Vol. 201, Springer-Verlag, Functional and Programming Languages and Computer Architecture, Nancy, France, September 1985.Google Scholar
- [Knuth 68]Donald E. Knuth, The Art of Computer Programming, Fundamental Algorithms, Addison-Wesley, 1968.Google Scholar
- [Kung & Song 77]H.T. Kung and S.W. Song, An Efficient Garbage Collection System and its Correctness Proof, Proceedings of IEEE 18th Symposium on Foundations of Computer Science, October 1977, pp 120–131.Google Scholar
- [Lang 87]Bernard Lang, Francis Dupont, Incremental Incrementally Compacting Garbage Collection, SIGPLAN'87 Symposium on Interpreters and Interpretive Techniques, Saint Paul, MA, pp 253–263.Google Scholar
- [Lieberman 83]
- [McCarthy 60]
- [Milner 84]Robin Milner, A Proposal for Standard ML, ACM Symposium on Program and Functional Programming, 1984, pp 184–197.Google Scholar
- [Moon 84]David A. Moon, Garbage Collection in a Large program System, 1984 ACM Symposium on Program and Functional Programming, Austin, Texas, pp 235–246.Google Scholar
- [Queinnec 88]Christian Queinnec, Dynamic Extent Objects, Lisp Pointers, Vol. 2, No 1, 1988.Google Scholar
- [Rees 84]Jonathan A. Rees, Norman I. Adams, James R. Meehan, The T Manual, Fourth Edition, 10 January 1984, Computer Science Department, Yale University, New Haven CT.Google Scholar
- [Van de Snepscheut 87]
- [Steele 75]
- [Symbolics Reference Manual]Symbolics Reference Manual, Symbolics.Google Scholar