Decreasing Memory Overhead in Hard Real-Time Garbage Collection
Automatic memory management techniques eliminate many programming errors that are both hard to find and to correct. However, these techniques are not yet used in embedded systems with hard realtime applications. The reason is that current methods for automatic memory management have a number of drawbacks. The two major ones are: (1) not being able to always guarantee short real-time deadlines and (2) using large amounts of extra memory. Memory is usually a scarce resource in embedded applications.
In this paper we present a new technique, Real-Time Reference Counting (RTRC) that overcomes the current problems and makes automatic memory management attractive also for hard real-time applications. The main contribution of RTRC is that often all memory can be used to store live objects. This should be compared to a memory overhead of about 500% for garbage collectors based on copying techniques and about 50% for garbage collectors based on mark-and-sweep techniques.
KeywordsExecution Time Garbage Collection Garbage Collector Memory Overhead Free List
Unable to display preview. Download preview PDF.
- 1.D. Bacon and V. Rajan. Concurrent cycle collection in reference counted systems. In Proceedings of the Fifteenth European Conference on Object-Oriented Programming (ECOOP), Lecture Notes in Computer Science, volume 2072. University Eötvös Loránd, Budapest, Hungary, Springer-Verlag, June 2001.Google Scholar
- 2.H. G. Baker. Minimising reference count updating with deferred and anchored pointers for functional data structures. A CM SIGPLAN Notices, 29(9), Sept. 1994.Google Scholar
- 3.J. M. Barth. Shifting garbage collection overhead to compile time. Communications of the ACM, 20(7):513–518, July 1977.Google Scholar
- 4.D. G. Bobrow. Managing re-entrant structures using reference counts. ACM Transactions on Programming Languages and Systems, 2(3):269–273, July 1980.Google Scholar
- 5.R. A. Brooks. Trading data space for reduced time and code space in real-time garbage collection on stock hardware. In G. L. Steele, editor, Conference Record of the 1984 ACM Symposium on Lisp and Functional Programming, pages 256–262, Austin, TX, Aug. 1984. ACM Press.Google Scholar
- 6.D. R. Brownbridge. Cyclic reference counting for combinator machines. In J.-P. Jouannaud, editor, Record of the 1985 Conference on Functional Programming and Computer Architecture, volume 201 of Lecture Notes in Computer Science, Nancy, France, Sept. 1985. Springer-Verlag.Google Scholar
- 8.T. W. Christopher. Reference count garbage collection. Software Practice and Experience, 14(6):503–507, June 1984.Google Scholar
- 9.G. E. Collins. A method for overlapping and erasure of lists. Communications of the ACM, 3(12):655–657, Dec. 1960.Google Scholar
- 10.L. P. Deutsch and D. G. Bobrow. An efficient incremental automatic garbage collector. Communications of the ACM, 19(9):522–526, Sept. 1976.Google Scholar
- 11.R. R. Fenichel and J. C. Yochelson. A Lisp garbage collector for virtual memory computer systems. Communications of the ACM, 12(11):611–612, Nov. 1969.Google Scholar
- 12.R. Henriksson. Scheduling Garbage Collection in Embedded Systems. PhD thesis, Lund Institute of Technology, July 1998.Google Scholar
- 13.M. S. Johnstone and P. R. Wilson. The memory fragmentation problem: Solved? In P. Dickman and P. R. Wilson, editors, OOPSLA’ 97 Workshop on Garbage Collection and Memory Management, Oct. 1997.Google Scholar
- 14.T. Ritzau, M. Beemster, F. Liekweg, and C. Probst. JoC — the JOSES compiler. Presented at the Java for Embedded Systems Workshop, London, May 2000.Google Scholar
- 15.R. A. Saunders. The LISP system for the Q-32 computer. In E. C. Berkeley and D. G. Bobrow, editors, The Programming Language LISP: Its Operation and Applications, pages 220–231, Cambridge, MA, 1974. Information International, Inc.Google Scholar
- 16.F. Siebert. Guaranteeing non-disruptiveness and real-time deadlines in an incremental garbage collector. In R. Jones, editor, Proceedings of the First International Symposium on Memory Management, volume 34(3) of ACM SIGPLAN Notices, pages 130–137, Vancouver, Oct. 1998. ACM Press. ISMM is the successor to the IWMM series of workshops.Google Scholar
- 17.F. Siebert. Eliminating external fragmentation in a non-moving garbage collector for Java. In Proceedings of Compilers, Architectures and Synthesis for Embedded Systems (CASES’00), San Jose, November 2000.Google Scholar
- 18.A. Veen. The JOSES project-compiling Java for embedded systems. In D. U. Assmann, editor, Java Optimization Strategies for Embedded Systems Workshop at ETAPS 2001, Genova, Italy, Apr. 2001.Google Scholar
- 19.J. Weizenbaum. Symmetric list processor. Communications of the ACM, 6(9):524–544, Sept. 1963.Google Scholar