Dynamic object sampling for pretenuring

Many state-of-the-art garbage collectors are generational, collecting the young nursery objects more frequently than old objects. These collectors perform well because young objects tend to die at a higher rate than old ones. However, these collectors do not examine object lifetimes with respect to any particular program or allocation site. This paper introduces low-cost object sampling to dynamically determine lifetimes. The sampler marks an object and records its allocation site every n bytes of allocation. The collector then computes per-site nursery survival rates. Sampling degrades total performance by only 3 on average for sample rates of 256 bytes in jikes, a rate at which overall lifetime accuracy compares well with sampling every object. An adaptive collector can use this information to tune itself. For example, pretenuring decreases nursery collection work by allocating new, but long-lived, objects directly into the mature space. We introduce a dynamic pretenuring mechanism that detects long lived allocation sites and pretenures them, given sufficient samples. To react to phase changes, it occasionally backsamples. As with previous online pretenuring, consistent performance improvements on SPECjvm98 benchmarks are difficult to attain since only two combine sufficient allocation load with high nursery survival. Our pretenuring system consistently improves one of these, javac, by 2% to 9% of total time by decreasing collection time by over a factor of two. Sampling and pretenuring overheads slow down all the others. This paper thus provides an efficient sampling mechanism that accurately predicts lifetimes, but leaves open optimization policies that can exploit this information.

[1]  Timothy L. Harris,et al.  Dynamic adaptive pre-tenuring , 2000, ISMM '00.

[2]  William D. Clinger,et al.  Generational garbage collection and the radioactive decay model , 1997, PLDI '97.

[3]  Matthew L. Seidl,et al.  Segregating heap objects by reference behavior and lifetime , 1998, ASPLOS VIII.

[4]  J. Morris Chang,et al.  Dynamic pretenuring schemes for generational garbage collection , 2004, IEEE International Symposium on - ISPASS Performance Analysis of Systems and Software, 2004.

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

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

[7]  Laurie J. Hendren,et al.  An adaptive, region-based allocator for java , 2002, MSP/ISMM.

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

[9]  Benjamin G. Zorn,et al.  Using lifetime predictors to improve memory allocation performance , 1993, PLDI '93.

[10]  Lieven Eeckhout,et al.  How java programs interact with virtual machines at the microarchitectural level , 2003, OOPSLA '03.

[11]  David R. Hanson Fast allocation and deallocation of memory based on object lifetimes , 1990, Softw. Pract. Exp..

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

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

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

[15]  Urs Hölzle,et al.  A Study of the Allocation Behavior of the SPECjvm98 Java Benchmark , 1999, ECOOP.

[16]  Rajesh Bordawekar,et al.  Exploiting prolific types for memory management and optimizations , 2002, POPL '02.

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

[18]  Erez Petrank,et al.  Thread-local heaps for Java , 2002, ISMM '02.

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

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

[21]  Alex Garthwaite,et al.  Efficient object sampling via weak references , 2000, ISMM '00.

[22]  Feng Qian,et al.  An adaptive, region-based allocator for java , 2002, ISMM '02.

[23]  Frank Jackson,et al.  Tenuring policies for generation-based storage reclamation , 1988, OOPSLA '88.

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