ABSTRACT
Reference counting memory management is often advocated as a technique for reducing or avoiding the pauses associated with tracing garbage collection. We present some measurements to remind the reader that classic reference count implementations may in fact exhibit longer pauses than tracing collectors.We then analyze reference counting with lazy deletion, the standard technique for avoiding long pauses by deferring deletions and associated reference count decrements, usually to allocation time. Our principal result is that if each reference count operation is constrained to take constant time, then the overall space requirements can be increased by a factor of Ω(R) in the worst case, where R is the ratio between the size of the largest and smallest allocated object. This bound is achievable, but probably large enough to render this design point useless for most real-time applications.We show that this space cost can largely be avoided if allocating an $n$ byte object is allowed to additionally perform O(n) reference counting work.
References
- D. F. Bacon, C. R. Attanasio, H. B. Lee, V. T. Rajan, and S. Smith. Java without the coffee breaks: A nonintrusive multiprocessor garbage collector. In Proceedings of the ACM SIGPLAN '01 Conference on Programming Language Design and Implementation, pages 92--103. ACM, 2001. Google Scholar
Digital Library
- D. F. Bacon, P. Cheng, and V. T. Rajan. A realtime garbage collector with low overhead and consistent utilization. In Conference Record of the Thirtieth Annual ACM Symposium on Principles of Programming Languages, pages 285--298, January 2003. Google Scholar
Digital Library
- D. F. Bacon and V. T. Rajan. Concurrent cycle collection in reference counted systems. In Proceedings of the Fifteenth European Conference on Object-Oriented Programming, LNCS 2072, pages 207--235. Springer, 2001. Google Scholar
Digital Library
- H. Baker. List processing in real time on a serial computer. Communications of the ACM, pages 280--294, April 1978. Google Scholar
Digital Library
- H.-J. Boehm. A garbage collector for C and C++. http://www.hpl.hp.com/personal/Hans_Boehm/gc/.Google Scholar
- H.-J. Boehm. Fast multiprocessor memory allocation and garbage collection. Technical Report HPL-2000-165, HP Laboratories, December 2000.Google Scholar
- H.-J. Boehm. Reducing garbage collector cache misses. In Proceedings of the 2000 International Symposium on Memory Management, pages 59--64, 2000. Google Scholar
Digital Library
- G. E. Collins. A method for overlapping and erasure of lists. CACM, 13(12):655--657, December 1960. Google Scholar
Digital Library
- G. Colvin, B. Dawes, P. Dimov, and D. Adler. Boost smart pointer library. http://www.boost.org/libs/smart_ptr/.Google Scholar
- J. DeTreville. Experience with concurrent garbage collectors for modula-2+. Technical Report~64, Digital Systems Research Center, August 1990.Google Scholar
- L. P. Deutsch and D. G. Bobrow. An efficient incremental automatic garbage collector. Communications of the ACM, 19(9):522--526, September 1976. Google Scholar
Digital Library
- S. Dieckman and U. Hölzle. A study of the allocation behavior of the SPECjvm98 Java benchmarks. Technical Report TRCS98-33, University of California at Santa Barbara, December 1998. Google Scholar
- M. S. Johnstone and P. R. Wilson. The memory fragmentation problem: solved? In Proceedings of the International Symposium on Memory Management 1998, pages 26--36, October 1998. Google Scholar
Digital Library
- R. Jones and R. Lins. Garbage Collection. John Wiley and Sons, 1996.Google Scholar
Digital Library
- Y. Levanoni and E. Petrank. An on-the-fly reference counting garbage collector for Java. In Conference on Object-Oriented Programming Systems and Languages (OOPSLA), pages 367--380, 2001. Google Scholar
Digital Library
- T. Ritzau. Memory Efficient Hard Real-Time Garbage Collection. PhD thesis, Department of Computer and InformationScience, Linköping University, April 2003.Google Scholar
- S. G. Robertz and R. Henriksson. Time triggered garbage collection. In LCTES '03, pages 93--102. ACM, 2003. Google Scholar
Digital Library
- J. M. Robson. An estimate of the store size necessary for dynamic storage allocation. Journal of the ACM, 18(3):416--423, 1971. Google Scholar
Digital Library
- J. M. Robson. Bounds for some functions concerning dynamic storage allocation. Journal of the ACM, 21(3):491--499, 1974. Google Scholar
Digital Library
- D. J. Roth and D. S. Wise. One bit counts between unique and sticky. In Proceedings of the International Symposium on Memory Management 1998, pages 49--56, October 1998. Google Scholar
Digital Library
- F. Siebert and A. Walter. Deterministic execution of Java's primitive bytecode operations. In Java Virtual Machine Research and Technology Symposium, April 2001. Google Scholar
Digital Library
- W. R. Stoye, T. J. W. Clarke, and A. C. Norman. Some practical methods for rapid combinator reduction. In Conference on Lisp and Functional Programming, pages 159--166, 1984. Google Scholar
Digital Library
- J. Weizenbaum. Symmetric list processor. Communications of the ACM, 6(9):524--544, 1963. Google Scholar
Digital Library
- D. S. Wise, B. Heck, C. Hess, W. Hunt, and E. Ost. Research demonstration of a hardware reference-counting heap. LISP Symb. Computat., 10(2):159--181, July 1997. Google Scholar
Digital Library
Index Terms
The space cost of lazy reference counting






Comments