Generating object lifetime traces with Merlin

Programmers are writing a rapidly growing number of programs in object-oriented languages, such as Java and C#, that require garbage collection. Garbage collection traces and simulation speed up research by enabling deeper understandings of object lifetime behavior and quick exploration and design of new garbage collection algorithms. When generating perfect traces, the brute-force method of computing object lifetimes requires a whole-heap garbage collection at every potential collection point in the program. Because this process is prohibitively expensive, researchers often use granulated traces by collecting only periodically, for example, every 32 KB of allocation.We extend the state of the art for simulating garbage collection algorithms in two ways. First, we develop a systematic methodology for simulation studies of copying garbage collection and present results showing the effects of trace granularity on these simulations. We show that trace granularity often distorts simulated garbage collection results compared with perfect traces. Second, we present and measure the performance of a new algorithm called Merlin for computing object lifetimes. Merlin timestamps objects and later uses the timestamps of dead objects to reconstruct when they died. The Merlin algorithm piggybacks on garbage collections performed by the base system. Experimental results show that Merlin can generate traces over two orders of magnitude faster than the brute-force method which collects after every object allocation. We also use Merlin to produce visualizations of heap behavior that expose new object lifetime behaviors.

[1]  Mooly Sagiv,et al.  Estimating the impact of heap liveness information on space consumption in Java , 2002, ISMM '02.

[2]  David M. Ungar,et al.  Generation Scavenging: A non-disruptive high performance storage reclamation algorithm , 1984, SDE 1.

[3]  Bowen Alpern,et al.  Implementing jalapeño in Java , 1999, OOPSLA '99.

[4]  Niklas Röjemo,et al.  Lag, drag, void and use—heap profiling and space-efficient compilation revisited , 1996, ICFP '96.

[5]  Nathaniel John Nystrom,et al.  BYTECODE-LEVELANALYSIS AND OPTIMIZATION OF JAVA CLASSES , 1998 .

[6]  David Ungar Generation scavenging: a nondisruptive high performance storage reclamation algorithm , 1984 .

[7]  Kathryn S. McKinley,et al.  Age-based garbage collection , 1999, OOPSLA '99.

[8]  Peter Lee,et al.  Generational stack collection and profile-driven pretenuring , 1998, PLDI.

[9]  Patrick M. Sansom,et al.  Execution profiling for non-strict functional languages , 1994 .

[10]  J. Moss,et al.  Older-first garbage collection in practice: evaluation in a Java Virtual Machine , 2003, MSP '02.

[11]  Darko Stefanovic,et al.  A comparative performance evaluation of write barrier implementation , 1992, OOPSLA.

[12]  Amer Diwan,et al.  On the usefulness of type and liveness accuracy for garbage collection and leak detection , 2002, TOPL.

[13]  Darko Stefanovic,et al.  Properties of age-based automatic memory reclamation algorithms , 1999 .

[14]  Andrew W. Appel,et al.  Simple generational garbage collection and fast allocation , 1989, Softw. Pract. Exp..

[15]  Colin Runciman,et al.  Heap Profiling of a Lazy Functional Compiler , 1992, Functional Programming.

[16]  Perry Cheng,et al.  The garbage collection advantage: improving program locality , 2004, OOPSLA.

[17]  Darko Stefanovic,et al.  A comparative performance evaluation of write barrier implementation , 1992, OOPSLA '92.

[18]  Colin Runciman,et al.  Heap profiling of lazy functional programs , 1993, Journal of Functional Programming.

[19]  Amer Diwan,et al.  Understanding the connectivity of heap objects , 2002, ISMM '02.

[20]  Kathryn S. McKinley,et al.  On Models for Object Lifetimes , 2000, International Symposium on Mathematical Morphology and Its Application to Signal and Image Processing.

[21]  Kathryn S. McKinley,et al.  Ulterior reference counting: fast garbage collection without a long wait , 2003, OOPSLA '03.

[22]  Kathryn S. McKinley,et al.  Ulterior reference counting: fast garbage collection without a long wait , 2003, OOPSLA 2003.

[23]  Perry Cheng,et al.  Myths and realities: the performance impact of garbage collection , 2004, SIGMETRICS '04/Performance '04.

[24]  Stephen J. Fink,et al.  The Jalapeño virtual machine , 2000, IBM Syst. J..

[25]  Amer Diwan,et al.  Connectivity-based garbage collection , 2003, OOPSLA 2003.

[26]  Kathryn S. McKinley,et al.  On models for object lifetime distributions , 2000, ISMM '00.

[27]  Benjamin G. Zorn,et al.  Comparative performance evaluation of garbage collection algorithms , 1989 .

[28]  Daniel G. Bobrow,et al.  An efficient, incremental, automatic garbage collector , 1976, CACM.

[29]  Kathryn S. McKinley,et al.  Error-free garbage collection traces: how to cheat and not get caught , 2002, SIGMETRICS '02.

[30]  Kathryn S. McKinley,et al.  Older-first garbage collection in practice: evaluation in Java Virtual Machine , 2002, MSP/ISMM.

[31]  Kathryn S. McKinley,et al.  Beltway: getting around garbage collection gridlock , 2002, PLDI '02.

[32]  Perry Cheng,et al.  Oil and water? High performance garbage collection in Java with MMTk , 2004, Proceedings. 26th International Conference on Software Engineering.

[33]  V. T. Rajan,et al.  Concurrent Cycle Collection in Reference Counted Systems , 2001, ECOOP.

[34]  Emery D. Berger,et al.  Automatic vs. Explicit Memory Management: Settling the Performance Debate , 2004 .

[35]  Neil Immerman,et al.  Framework for Analyzing Garbage Collection , 2002, IFIP TCS.

[36]  Rafael Dueire Lins,et al.  Garbage collection: algorithms for automatic dynamic memory management , 1996 .

[37]  George E. Collins,et al.  A method for overlapping and erasure of lists , 1960, CACM.

[38]  Kathryn S. McKinley,et al.  Data flow analysis for software prefetching linked data structures in Java , 2001, Proceedings 2001 International Conference on Parallel Architectures and Compilation Techniques.

[39]  Henry Lieberman,et al.  A real-time garbage collector based on the lifetimes of objects , 1983, CACM.

[40]  Frank Jackson,et al.  An adaptive tenuring policy for generation scavengers , 1992, TOPL.

[41]  Elliot K. Kolodner,et al.  On effectiveness of GC in Java , 2000, ISMM '00.

[42]  Simon L. Peyton Jones,et al.  Time and space profiling for non-strict, higher-order functional languages , 1995, POPL '95.

[43]  Kathryn S. McKinley,et al.  Pretenuring for Java , 2001, OOPSLA '01.

[44]  Dirk Grunwald,et al.  Evaluating models of memory allocation , 1994, TOMC.

[45]  S. C. Vestal,et al.  Garbage collection: an exercise in distributed, fault-tolerant programming , 1987 .