skip to main content
article

The space cost of lazy reference counting

Published: 01 January 2004 Publication History

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

[1]
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.
[2]
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.
[3]
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.
[4]
H. Baker. List processing in real time on a serial computer. Communications of the ACM, pages 280--294, April 1978.
[5]
H.-J. Boehm. A garbage collector for C and C++. http://www.hpl.hp.com/personal/Hans_Boehm/gc/.
[6]
H.-J. Boehm. Fast multiprocessor memory allocation and garbage collection. Technical Report HPL-2000-165, HP Laboratories, December 2000.
[7]
H.-J. Boehm. Reducing garbage collector cache misses. In Proceedings of the 2000 International Symposium on Memory Management, pages 59--64, 2000.
[8]
G. E. Collins. A method for overlapping and erasure of lists. CACM, 13(12):655--657, December 1960.
[9]
G. Colvin, B. Dawes, P. Dimov, and D. Adler. Boost smart pointer library. http://www.boost.org/libs/smart_ptr/.
[10]
J. DeTreville. Experience with concurrent garbage collectors for modula-2+. Technical Report~64, Digital Systems Research Center, August 1990.
[11]
L. P. Deutsch and D. G. Bobrow. An efficient incremental automatic garbage collector. Communications of the ACM, 19(9):522--526, September 1976.
[12]
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.
[13]
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.
[14]
R. Jones and R. Lins. Garbage Collection. John Wiley and Sons, 1996.
[15]
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.
[16]
T. Ritzau. Memory Efficient Hard Real-Time Garbage Collection. PhD thesis, Department of Computer and InformationScience, Linköping University, April 2003.
[17]
S. G. Robertz and R. Henriksson. Time triggered garbage collection. In LCTES '03, pages 93--102. ACM, 2003.
[18]
J. M. Robson. An estimate of the store size necessary for dynamic storage allocation. Journal of the ACM, 18(3):416--423, 1971.
[19]
J. M. Robson. Bounds for some functions concerning dynamic storage allocation. Journal of the ACM, 21(3):491--499, 1974.
[20]
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.
[21]
F. Siebert and A. Walter. Deterministic execution of Java's primitive bytecode operations. In Java Virtual Machine Research and Technology Symposium, April 2001.
[22]
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.
[23]
J. Weizenbaum. Symmetric list processor. Communications of the ACM, 6(9):524--544, 1963.
[24]
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.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 39, Issue 1
POPL '04
January 2004
352 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/982962
Issue’s Table of Contents
  • cover image ACM Conferences
    POPL '04: Proceedings of the 31st ACM SIGPLAN-SIGACT symposium on Principles of programming languages
    January 2004
    364 pages
    ISBN:158113729X
    DOI:10.1145/964001
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 January 2004
Published in SIGPLAN Volume 39, Issue 1

Check for updates

Author Tags

  1. garbage collection
  2. memory allocation
  3. reference counting
  4. space complexity

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)8
  • Downloads (Last 6 weeks)0
Reflects downloads up to 10 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2017)Limitations of Partial CompactionACM Transactions on Programming Languages and Systems10.1145/299459739:1(1-44)Online publication date: 6-Mar-2017
  • (2012)Space overhead bounds for dynamic memory management with partial compactionACM Transactions on Programming Languages and Systems10.1145/2362389.236239234:3(1-43)Online publication date: 5-Nov-2012
  • (2024)Being Lazy When It CountsFunctional and Logic Programming10.1007/978-981-97-2300-3_11(188-216)Online publication date: 15-May-2024
  • (2018)FRC: a high-performance concurrent parallel deferred reference counter for C++ACM SIGPLAN Notices10.1145/3299706.321056953:5(14-28)Online publication date: 18-Jun-2018
  • (2018)FRC: a high-performance concurrent parallel deferred reference counter for C++Proceedings of the 2018 ACM SIGPLAN International Symposium on Memory Management10.1145/3210563.3210569(14-28)Online publication date: 18-Jun-2018
  • (2017)A Dynamic Memory Management Unit for Real Time Systems2017 IEEE 20th International Symposium on Real-Time Distributed Computing (ISORC)10.1109/ISORC.2017.4(84-91)Online publication date: May-2017
  • (2014)Implementation of Enhanced Singly Linked List Equipped with DLL Operations: An Approach towards Enormous Memory SavingInternational Journal of Future Computer and Communication10.7763/IJFCC.2014.V3.276(98-101)Online publication date: 2014
  • (2013)Limitations of partial compactionACM SIGPLAN Notices10.1145/2499370.249197348:6(309-320)Online publication date: 16-Jun-2013
  • (2013)Limitations of partial compactionProceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/2491956.2491973(309-320)Online publication date: 16-Jun-2013
  • (2011)Space overhead bounds for dynamic memory management with partial compactionProceedings of the 38th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages10.1145/1926385.1926441(475-486)Online publication date: 26-Jan-2011
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media