Cork: dynamic memory leak detection for garbage-collected languages

A memory leak in a garbage-collected program occurs when the program inadvertently maintains references to objects that it no longer needs. Memory leaks cause systematic heap growth, degrading performance and resulting in program crashes after perhaps days or weeks of execution. Prior approaches for detecting memory leaks rely on heap differencing or detailed object statistics which store state proportional to the number of objects in the heap. These overheads preclude their use on the same processor for deployed long-running applications.This paper introduces a dynamic heap-summarization technique based on type that accurately identifies leaks, is space efficient (adding less than 1% to the heap), and is time efficient (adding 2.3% on average to total execution time). We implement this approach in Cork which utilizes dynamic type information and garbage collection to summarize the live objects in a type points-from graph (TPFG) whose nodes (types) and edges (references between types) are annotated with volume. Cork compares TPFGs across multiple collections, identifies growing data structures, and computes a type slice for the user. Cork is accurate: it identifies systematic heap growth with no false positives in 4 of 15 benchmarks we tested. Cork's slice report enabled us (non-experts) to quickly eliminate growing data structures in SPECjbb2000 and Elipse, something their developers had not previously done. Cork is accurate, scalable, and efficient enough to consider using online.

[1]  Gary Sevitsky,et al.  Visualizing reference patterns for solving memory leaks in Java , 1999, Concurr. Pract. Exp..

[2]  Yuanyuan Zhou,et al.  SafeMem: exploiting ECC-memory for detecting memory leaks and memory corruption during production runs , 2005, 11th International Symposium on High-Performance Computer Architecture.

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

[4]  Amer Diwan,et al.  The DaCapo benchmarks: java benchmarking development and analysis , 2006, OOPSLA '06.

[5]  Nick Mitchell,et al.  LeakBot: An Automated and Lightweight Tool for Diagnosing Memory Leaks in Large Java Applications , 2003, ECOOP.

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

[7]  Niklas Röjemo,et al.  Generational Garbage Collection without Temporary Space Leaks for Lazy Functional Languages , 1995, IWMM.

[8]  Gary Sevitsky,et al.  Visualizing reference patterns for solving memory leaks in Java , 1999, Concurr. Pract. Exp..

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

[10]  Hans-Juergen Boehm,et al.  Understanding memory allocation of scheme programs , 2000, ICFP '00.

[11]  Elliot K. Kolodner,et al.  Automatic Removal of Array Memory Leaks in Java , 2000, CC.

[12]  Michael D. Bond,et al.  Bell: bit-encoding online memory leak detection , 2006, ASPLOS XII.

[13]  Matthias Hauswirth,et al.  Low-overhead memory leak detection using adaptive statistical profiling , 2004, ASPLOS XI.

[14]  Monica S. Lam,et al.  A practical flow-sensitive and context-sensitive C and C++ memory leak detector , 2003, PLDI '03.

[15]  Matthew Arnold,et al.  Adaptive optimization in the Jalapeño JVM , 2000, OOPSLA '00.

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

[17]  Mark N. Wegman,et al.  Execution Patterns in Object-Oriented Visualization , 1998, COOTS.

[18]  Niklas Röjemo,et al.  Heap Profiling for Space Efficiency , 1996, Advanced Functional Programming.

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

[20]  Kathryn S. McKinley,et al.  Cork: Dynamic Memory Leak Detection for Java , 2006 .