skip to main content
10.1145/1190216.1190224acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article

Cork: dynamic memory leak detection for garbage-collected languages

Published:17 January 2007Publication History

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle Scholar
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarCross RefCross Ref
  12. 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 ScholarGoogle Scholar
  13. 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 ScholarGoogle Scholar
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle Scholar
  17. N. Mitchell, May 2006. Personal communication.]]Google ScholarGoogle Scholar
  18. 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 ScholarGoogle Scholar
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. QuestSoftware. JProbe Memory Debugger: Eliminate Memory Leaks and Excessive Garbage Collection. http://www.quest.com/jprobe/profiler.asp.]]Google ScholarGoogle Scholar
  21. N. Röjemo. Generational Garbage Collection without Temporary Space Leaks. In IWMM 95: Proceeding of the International Workshop on Memory Management, 1995.]]Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  26. Standard Performance Evaluation Corporation. SPECjvm98 Documentation, release 1.03 edition, March 1999.]]Google ScholarGoogle Scholar
  27. Standard Performance Evaluation Corporation. SPECjbb2000 (Java Business Benchmark) Documentation, release 1.01 edition, 2001.]]Google ScholarGoogle Scholar
  28. Sun Microsystems. Heap Analysis Tool. https://hat.dev.java.net/.]]Google ScholarGoogle Scholar
  29. Sun Microsystems. HPROF Profiler Agent. http://java.sun.com/j2se/1.4.2/docs/guide/jvmpi/jvmpi.html.]]Google ScholarGoogle Scholar
  30. The Eclipse Foundation. Eclipse Homepage. http://www.eclipse.org.]]Google ScholarGoogle Scholar

Index Terms

  1. Cork: dynamic memory leak detection for garbage-collected languages

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      POPL '07: Proceedings of the 34th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
      January 2007
      400 pages
      ISBN:1595935754
      DOI:10.1145/1190216
      • cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 42, Issue 1
        Proceedings of the 2007 POPL Conference
        January 2007
        379 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1190215
        Issue’s Table of Contents

      Copyright © 2007 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 17 January 2007

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • Article

      Acceptance Rates

      Overall Acceptance Rate824of4,130submissions,20%

      Upcoming Conference

      POPL '25

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader