Object Lifetime Prediction in Java

Accurately predicting the lifetimes of objects in object-oriented and functional languages is important because such predictions can be used to improve memory management performance at run-time. A typical approach to this prediction problem is first to observe object lifetimes by tracing a sample program execution, then to construct a predictor function based on these observations, and finally to test the predictions on reference program executions. Four quantitative measures characterize this approach: coverage, the proportion of objects in the reference program execution for which the predictor function is defined; accuracy, the fraction of predicted lifetimes that are correct; precision, the granularity of the predictions; and size, the size of the predictor itself. These four properties are not independent; for example, increased precision often leads to less coverage and accuracy. We describe a fully precise prediction method and report experimental results on its performance. By “fully precise” we mean that the granularity of predictions is equal to the smallest unit of allocation. We show that for a number of benchmark programs in the Java programming language, fully precise prediction can be achieved, together with high coverage and accuracy. Our results also show that a significant proportion of objects have a measured lifetime of zero, a fact which a dynamic compiler could use to avoid explicit allocation. The method described here is the first to combine high-precision and efficiency in a single lifetime predictor.

[1]  David A. Cohn,et al.  Predicting Lifetimes in Dynamically Allocated Memory , 1996, NIPS.

[2]  Stephanie Forrest,et al.  A sense of self for Unix processes , 1996, Proceedings 1996 IEEE Symposium on Security and Privacy.

[3]  Urs Hölzle,et al.  The allocation behavior of the SPECjvm98 Java benchmarks , 2001 .

[4]  Anne Rogers,et al.  Software caching and computation migration in Olden , 1995, PPOPP '95.

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

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

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

[8]  Stephanie Forrest,et al.  Anomaly intrusion detection in dynamic execution environments , 2002, NSPW '02.

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

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

[11]  Kathryn S. McKinley,et al.  Tolerating Latency by Prefetching Java Objects , 1999 .

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

[13]  Ben Zorn,et al.  Predicting References to Dynamically Allocated Objects , 1997 .

[14]  Craig B. Zilles Benchmark health considered harmful , 2001, CARN.

[15]  Todd L. Heberlein,et al.  Network intrusion detection , 1994, IEEE Network.

[16]  Ron Cytron,et al.  Contaminated garbage collection , 2000, PLDI '00.

[17]  Biswanath Mukherjee,et al.  A network security monitor , 1990, Proceedings. 1990 IEEE Computer Society Symposium on Research in Security and Privacy.

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

[19]  Barry Hayes Key Objects in Garbage Collection , 1993 .

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

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

[22]  Anne Rogers,et al.  Supporting dynamic data structures on distributed-memory machines , 1995, TOPL.

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

[24]  Robert P. Fitzgerald,et al.  The case for profile-directed selection of garbage collectors , 2000, ISMM '00.

[25]  Barry Hayes,et al.  Using key object opportunism to collect old objects , 1991, OOPSLA '91.

[26]  Matthew L. Seidl,et al.  Predicting References to Dynamically Allocated Objects ; CU-CS-826-97 , 1997 .