ABSTRACT
In many garbage collected systems, the mutator performs a write barrier for every pointer update. Using generational garbage collectors, we study in depth three code placement options for remembered-set write barriers: inlined, out-of-line, and partially inlined (fast path inlined, slow path out-of-line). The fast path determines if the collector needs to remember thepointer update. The slow path records the pointer in a list when necessary. Efficient implementations minimize the instructions on the fast path, and record few pointers (from 0.16 to 3% of pointer stores in our benchmarks). We find the mutator performs best with a partially inlined barrier, by a modest 1.5% on average over full inlining.We also study the compilation cost of write-barrier code placement. We find that partial inlining reduces the compilation cost by 20 to 25% compared to full inlining. In the context of just-in-time compilation, the application is exposed to compiler activity. Regardless of the level of compiler activity, partial inlining consistently gives a total running time performance advantage over full inlining on the benchmarks. When the compiler optimizes all application methods on demand and compiler load is highest, partial inlining improves total performance on average by 10.2%, and up to 18.5%.
- Bowen Alpern, Dick Attanasio, John J. Barton, M. G. Burke, P. Cheng, J.-D. Choi, Anthony Cocchi, Stephen J. Fink, David Grove, Michael Hind, Susan Flynn Hummel, D. Lieber, V. Litvinov, Mark Mergen, Ton Ngo, J. R. Russell, Vivek Sarkar, Manuel J. Serrano, Janice Shepherd, S. Smith, V. C. Sreedhar, H. Srinivasan, and J. Whaley. The Jalapeño virtual machine. IBM System Journal, 39(1):211--238, February 2000 Google ScholarDigital Library
- Bowen Alpern, C. R. Attanasio, Anthony Cocchi, Derek Lieber, Stephen Smith, Ton Ngo, John J. Barton, Susan~Flynn Hummel, Janice~C. Sheperd, and Mark Mergen. Implementing Jalapeño in Java. In OOPSLA'99 ACM Conference on Object-Oriented Systems, Languages and Applications, volume 34(10) of ACM SIGPLAN Notices, pages 314--324, Denver, CO, October 1999. ACM Press. Google ScholarDigital Library
- Matthew Arnold, Stephen~J. Fink, David Grove, Michael Hind, and Peter Sweeney. Adaptive optimization in the Jalapeño JVM. In OOPSLA'00 ACM Conference on Object-Oriented Systems, Languages and Applications, volume 35(10) of ACM SIGPLAN Notices, pages 47--65, Minneapolis, MN, October 2000. ACM Press Google ScholarDigital Library
- Matthew Arnold, Stephen Fink, Vivek Sarkar, and Peter F. Sweeney. A comparative study of static and profile-based heuristics for inlining. In Proceedings of the ACM SIGPLAN Workshop on Dynamic and Adaptive Compilation and Optimization, Boston, MA, 2000 Google ScholarDigital Library
- Alain Azagury, Elliot~K. Kolodner, Erez Petrank, and Zvi Yehudai. Combining card marking with remembered sets: How to save scanning time. In Richard Jones, editor, ISMM'98 Proceedings of the First International Symposium on Memory Management, volume 34(3) of ACM SIGPLAN Notices, pages 10--19, Vancouver, October 1998. ACM Press. ISMM is the successor to the IWMM series of workshops Google ScholarDigital Library
- Andrew W. Appel. Simple generational garbage collection and fast allocation. Software Practice and Experience, 19(2):171--183, 1989 Google ScholarDigital Library
- Andrew Ayers, Richard Schooler, and Robert Gottlieb. Aggressive inlining. In Proceedings of the SIGPLAN '97 Conference on Programming Language Design and Implementation, pages 134--145, Las Vegas, NV, June 1997 Google ScholarDigital Library
- Stephen M. Blackburn, Richard E. Jones, Kathryn S. McKinley, and J. Eliot B. Moss. Beltway: Getting around garbage collection gridlock. In Proceedings of SIGPLAN 2002 Conference on Programming Languages Design and Implementation, volume 37(5) of ACM SIGPLAN Notices, Berlin, Germany, June 2002. ACM Press Google ScholarDigital Library
- A.M. Cheadle, A.J. Field, Marlow S., S. Peyton-Jones, and R.L While. Non-stop Haskell. In Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP'00), volume 35(9) of ACM SIGPLAN Notices, pages 257--267, Montreal, September 2000. ACM Press Google ScholarDigital Library
- Craig Chambers. The Design and Implementation of the SELF Compiler, an Optimizing Compiler for an Objected-Oriented Programming Language. PhD thesis, Stanford University, March 1992 Google ScholarDigital Library
- K. Cooper, M. W. Hall, and K. Kennedy. Procedure cloning. In Proceedings of the 1992 IEEE International Conference on Computer Language, pages 96--105, Oakland, CA, April 1992Google ScholarCross Ref
- K. Cooper, M. W. Hall, K. Kennedy, and L. Torczon. An experiment with inline substitution. Software---Practice and Experience, 21(6):581--501, April 1993 Google ScholarDigital Library
- Perry Cheng, Robert Harper, and Peter Lee. Generational stack collection and profile-driven pretenuring. In Proceedings of SIGPLAN'98 Conference on Programming Languages Design and Implementation, volume 33(5) of ACM SIGPLAN Notices, pages 162--173, Montreal, June 1998. ACM Press Google ScholarDigital Library
- Keith D. Cooper, Mary W. Hall, and Linda Torczon. Unexpected side effects of inline substitution. ACM Letters on Programming Languages and Systems, 1(1):22--32, March 1992 Google ScholarDigital Library
- George E. Collins. A method for overlapping and erasure of lists. Communications of the ACM, 3(12):655--657, December 1960 Google ScholarDigital Library
- Patrick J. Caudill and Allen Wirfs-Brock. A third-generation Smalltalk-80 implementation. In Norman Meyrowitz, editor, OOPSLA'86 ACM Conference on Object-Oriented Systems, Languages and Applications, volume 21(11) of ACM SIGPLAN Notices, pages 119--130. ACM Press, October 1986 Google ScholarDigital Library
- L. Peter Deutsch and Daniel G. Bobrow. An efficient incremental automatic garbage collector. Communications of the ACM, 19(9):522--526, September 1976 Google ScholarDigital Library
- Jeffrey Dean and Craig Chambers. Towards better inlining decisions using inlining trials. In Proceedings of the ACM Conference on Lisp and Functional Programming, pages 273--282, Orlando, FL, June 1994 Google ScholarDigital Library
- Stephen J. Fink and David Grove. Personal communication. January 2002Google Scholar
- Robert Fitzgerald and David Tarditi. The case for profile-directed selection of garbage collectors. In Tony Hosking, editor, ISMM 2000 Proceedings of the Second International Symposium on Memory Management, pages 50--58, Minneapolis, MN, October 2000 Google ScholarDigital Library
- Urs Hölzle. A fast write barrier for generational garbage collectors. In Eliot Moss, Paul R. Wilson, and Benjamin Zorn, editors, OOPSLA/ECOOP '93 Workshop on Garbage Collection in Object-Oriented Systems, October 1993Google Scholar
- Richard L. Hudson and Amer Diwan. Adaptive garbage collection for Modula-3 and Smalltalk. In Eric Jul and Niels-Christian Juul, editors, OOPSLA/ECOOP '90 Workshop on Garbage Collection in Object-Oriented Systems, Ottawa, October 1990.Google Scholar
- Antony L. Hosking and Richard L. Hudson. Remembered sets can also play cards. In Eliot Moss, Paul R. Wilson, and Benjamin Zorn, editors, OOPSLA/ECOOP '93 Workshop on Garbage Collection in Object-Oriented Systems, October 1993Google Scholar
- Richard L. Hudson and J. Eliot B. Moss. Incremental garbage collection for mature objects. In Yves Bekkers and Jacques Cohen, editors, Proceedings of International Workshop on Memory Management, volume 637 of Lecture Notes in Computer Science, University of Massachusetts, USA, 16--18 September 1992. Springer-Verlag Google ScholarDigital Library
- Antony L. Hosking, J. Eliot B. Moss, and Darko Stefanovic. A comparative performance evaluation of write barrier implementations. In Andreas Paepcke, editor, OOPSLA'92 ACM Conference on Object-Oriented Systems, Languages and Applications, volume 27(10) of ACM SIGPLAN Notices, pages 92--109, Vancouver, British Columbia, October 1992. ACM Press Google ScholarDigital Library
- Richard E. Jones and Rafael D. Lins. Garbage Collection: Algorithms for Automatic Dynamic Memory Management. Wiley, July 1996 Google ScholarDigital Library
- Henry Lieberman and Carl E. Hewitt. A real-time garbage collector based on the lifetimes of objects. Communications of the ACM, 26(6):419--429, 1983. Also report TM--184, Laboratory for Computer Science, MIT, Cambridge, MA, July 1980 and AI Lab Memo 569, 1981 Google ScholarDigital Library
- R. Scheifler. An analysis of inline substitution for a structured programming language. Communications of the ACM, 20(9):647--654, September 1977 Google ScholarDigital Library
- Darko Stefanovic, Kathryn S. McKinley, and J. Eliot B. Moss. Age-based garbage collection. In OOPSLA'99 ACM Conference on Object-Oriented Systems, Languages and Applications, volume 34(10) of ACM SIGPLAN Notices, pages 370--381, Denver, CO, October 1999. ACM Press Google ScholarDigital Library
- Patrick Sobalvarro. A lifetime-based garbage collector for Lisp systems on general-purpose computers. Technical Report AITR-1417, MIT AI Lab, February 1988. Bachelor of Science thesis Google ScholarDigital Library
- Darko Stefanovic. Properties of Age-Based Automatic Memory Reclamation Algorithms. PhD thesis, University of Massachusetts, 1999. Google ScholarDigital Library
- David M. Ungar. Generation scavenging: A non-disruptive high performance storage reclamation algorithm. ACM SIGPLAN Notices, 19(5):157--167, April 1984 Google ScholarDigital Library
- Paul R. Wilson and Thomas G. Moher. A card-marking scheme for controlling intergenerational references in generation-based garbage collection on stock hardware. ACM SIGPLAN Notices, 24(5):87--92, 1989 Google ScholarDigital Library
Index Terms
- In or out?: putting write barriers in their place
Recommendations
Barriers: friend or foe?
ISMM '04: Proceedings of the 4th international symposium on Memory managementModern garbage collectors rely on read and write barriers imposed on heap accesses by the mutator, to keep track of references between different regions of the garbage collected heap, and to synchronize actions of the mutator with those of the ...
Barriers reconsidered, friendlier still!
ISMM '12Read and write barriers mediate access to the heap allowing the collector to control and monitor mutator actions. For this reason, barriers are a powerful tool in the design of any heap management algorithm, but the prevailing wisdom is that they impose ...
In or out?: putting write barriers in their place
MSP 2002 and ISMM 2002In many garbage collected systems, the mutator performs a write barrier for every pointer update. Using generational garbage collectors, we study in depth three code placement options for remembered-set write barriers: inlined, out-of-line, and ...
Comments