Abstract
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.
- B. Alpern, C. R. Attanasio, A. Cocchi, D. Lieber, S. Smith, T. Ngo, J. J. Barton, S. F. Hummel, J. C. Sheperd, and M. Mergen. Implementing Jalapeño in Java. In OOPSLA '99: Proceeding of the 14th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 314--324, Denver, Colorado, USA, November 1999.]] Google Scholar
Digital Library
- M. Arnold, S. Fink, D. Grove, M. Hind, and P. F. Sweeney. Adaptive Optimization in the Jalapeño JVM. In OOPSLA '00: Proceedings of the 15th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 47--65, Minneapolis, Minnesota, USA, October 2000.]] Google Scholar
Digital Library
- S. M. Blackburn, P. Cheng, and K. S. McKinley. Myths and Realities: The Performance Impact on Garbage Collection. In Proceedings of the International Conference on Measurement and Modeling of Computer Systems, pages 25--36, New York, New York, USA, June 2004.]] Google Scholar
Digital Library
- S. M. Blackburn, P. Cheng, and K. S. McKinley. Oil and Water? High Performance Garbage Collection in Java with JMTk. In ICSE '04: Proceedings of the 26th International Conference on Software Engineering, pages 137--146, Scotland, United Kingdom, May 2004. IEEE Computer Society.]] Google Scholar
Digital Library
- S. M. Blackburn, R. Garner, C. Hoffman, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, D. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo Benchmarks: Java Benchmarking Development and Analysis. In OOPSLA '06: Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programing, Systems, Languages, and Applications, Portland, Oregon, USA, October 2006. http://www.dacapobench.org]] Google Scholar
Digital Library
- S. M. Blackburn, R. Garner, C. Hoffman, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, D. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo Benchmarks: Java Benchmarking Development and Analysis. Technical report, October 2006. http://www.dacapobench.org.]] Google Scholar
Digital Library
- M. D. Bond and K. S. McKinley. Bell: Bit-Encoding Online Memory Leak Detection. In ASPLOS XII: Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems, San Jose, California, USA, October 2006.]] Google Scholar
Digital Library
- J. Campan and E. Muller. Performance Tuning Essential for J2SE and J2EE: Minimize Memory Leaks with Borland Optimizeit Suite. White Paper, Borland Software Corporation, March 2002.]]Google Scholar
- T. M. Chilimbi and M. Hauswirth. Low-Overhead Memory Leak Detection using Adaptive Statistical Profiling. In ASPLOS-XI: Proceedings of the 11th International Conference on Architectural Support for Programming Languages and Operating Systems, pages 156--164, Boston, Massachusetts, USA, October 2004.]] Google Scholar
Digital Library
- W. De Pauw, D. Lorenz, J. Vlissides, and M. Wegman. Execution Patterns in Object-Oriented Visualization. In Proceedings of the 4th USENIX Conference on Object-Oriented Technologies and Systems (COOTS), pages 219--234, Santa Fe, New Mexico, USA, April 1998.]] Google Scholar
Digital Library
- W. De Pauw and G. Sevitsky. Visualizing Reference Patterns for Solving Memory Leaks in Java. Concurrency: Practice and Experience, 12(12):1431--1454, November 2000.]]Google Scholar
Cross Ref
- S. C. Gupta and R. Palanki. Java Memory Leaks -- Catch Me If You Can: Detecting Java Leaks using IBM Rational Application Developer 6.0. Technical report, IBM, August 2005.]]Google Scholar
- R. Hastings and B. Joyce. Purify: A Tool for Detecting Memory Leaks and Access Errors in C and C++ Programs. In Proceedings of the Winter 1992 USENIX Conference, pages 125--138, Berkley, California, USA, January 1992.]]Google Scholar
- D. L. Heine and M. S. Lam. A Practical Flow-Sensitive and Context-Sensitive C and C++ Memory Leak Detector. In PLDI '03: Proceedings of the ACM SIGPLAN 2003 Conference on Programming Language Design and Implementation, pages 168--181, San Diego, California, USA, June 2003.]] Google Scholar
Digital Library
- X. Huang, S. M. Blackburn, K. S. McKinley, J. E. B. Moss, Z. Wang, and P. Cheng. The Garbage Collection Advantage: Improving Program Locality. In OOPSLA '04: Proceedings of the 19th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 69--80, Vancouver, BC, Canada, October 2004.]] Google Scholar
Digital Library
- M. Jump and K. S. McKinley. Cork: Dynamic Memory Leak Detection for Java. Technical Report TR-06-07, Department of Computer Sciences, The University of Texas at Austin, Austin, Texas 78712, January 2006.]]Google Scholar
- N. Mitchell, May 2006. Personal communication.]]Google Scholar
- N. Mitchell and G. Sevitzky. LeakBot: An Automated and Lightweight Tool for Diagnosing Memory Leaks in Large Java Applications. In ECOOP 2003 -- Object Oriented Programming: 17th European Conference, volume 2743 of Lecture Notes in Computer Science, pages 351--377, Darmstadt, Germany, July 2003. Springer-Verlag.]]Google Scholar
- F. Qin, S. Lu, and Y. Zhou. SafeMem: Exploiting ECC-Memory for Detecting Memory Leaks and Memory Corruption During Production Runs. In HPCA-11: Proceedings of the 11th International Symposium on High-Performance Computer Architecture, pages 291--302, Cambridge, Massachusetts, USA, February 2002. IEEE Computer Society.]] Google Scholar
Digital Library
- QuestSoftware. JProbe Memory Debugger: Eliminate Memory Leaks and Excessive Garbage Collection. http://www.quest.com/jprobe/profiler.asp.]]Google Scholar
- N. Röjemo. Generational Garbage Collection without Temporary Space Leaks. In IWMM 95: Proceeding of the International Workshop on Memory Management, 1995.]]Google Scholar
Digital Library
- N. Röjemo and C. Runciman. Lag, Drag, Void and Use -- Heap Profiling and Space-Efficient Compilation Revised. In ICFP '96: Proceedings of the First ACM SIGPLAN International Conference on Functional Programming, pages 34--41, Philadelphia, Pennsylvania, USA, May 1996.]] Google Scholar
Digital Library
- C. Runciman and N. Röjemo. Heap Profiling for Space Efficiency. In E. M. J. Launchbury and T. Sheard, editors, Advanced Functional Programming, Second International School-Tutorial Text, pages 159--183, London, United Kingdome, August 1996. Springer-Verlag.]] Google Scholar
Digital Library
- M. Serrano and H.-J. Boehm. Understanding Memory Allocation of Scheme Programs. In ICFP '00: Proceedings of the Fifth ACM SIGPLAN International Conference on Functional Programming, pages 245--256, Montréal, Québec, Canada, September 2000.]] Google Scholar
Digital Library
- R. Shaham, E. K. Kolodner, and M. Sagiv. Automatic Removal of Array Memory Leaks in Java. In CC '00: Proceedings of the 9th International Conference on Compiler Construction, volume 1781 of Lecture Notes in Computer Science, pages 50--66, London, United Kingdom, 2000. Springer-Verlag.]] Google Scholar
Digital Library
- Standard Performance Evaluation Corporation. SPECjvm98 Documentation, release 1.03 edition, March 1999.]]Google Scholar
- Standard Performance Evaluation Corporation. SPECjbb2000 (Java Business Benchmark) Documentation, release 1.01 edition, 2001.]]Google Scholar
- Sun Microsystems. Heap Analysis Tool. https://hat.dev.java.net/.]]Google Scholar
- Sun Microsystems. HPROF Profiler Agent. http://java.sun.com/j2se/1.4.2/docs/guide/jvmpi/jvmpi.html.]]Google Scholar
- The Eclipse Foundation. Eclipse Homepage. http://www.eclipse.org.]]Google Scholar
Index Terms
Cork: dynamic memory leak detection for garbage-collected languages
Recommendations
Cork: dynamic memory leak detection for garbage-collected languages
POPL '07: Proceedings of the 34th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languagesA 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 ...
Detecting memory leaks in managed languages with Cork
A memory leak in a managed language occurs when the program inadvertently maintains references to objects that it no longer needs. Memory leaks cause systematic heap growth that degrade performance and can result in program crashes after perhaps days or ...
Autonomous Garbage Collection: Resolving Memory Leaks in Long Running Network Applications
IC3N '98: Proceedings of the International Conference on Computer Communications and NetworksGarbage collection is especially useful for long running server applications in network environments since sustained memory leaks continuously degrade performance and eventually result in application failure. We demonstrate the benefits of a garbage ...






Comments