Nothing Special   »   [go: up one dir, main page]

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 2007 Publication 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.]]
[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.]]
[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.]]
[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.]]
[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]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[17]
N. Mitchell, May 2006. Personal communication.]]
[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.]]
[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.]]
[20]
QuestSoftware. JProbe Memory Debugger: Eliminate Memory Leaks and Excessive Garbage Collection. http://www.quest.com/jprobe/profiler.asp.]]
[21]
N. Röjemo. Generational Garbage Collection without Temporary Space Leaks. In IWMM 95: Proceeding of the International Workshop on Memory Management, 1995.]]
[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.]]
[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.]]
[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.]]
[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.]]
[26]
Standard Performance Evaluation Corporation. SPECjvm98 Documentation, release 1.03 edition, March 1999.]]
[27]
Standard Performance Evaluation Corporation. SPECjbb2000 (Java Business Benchmark) Documentation, release 1.01 edition, 2001.]]
[28]
Sun Microsystems. Heap Analysis Tool. https://hat.dev.java.net/.]]
[29]
Sun Microsystems. HPROF Profiler Agent. http://java.sun.com/j2se/1.4.2/docs/guide/jvmpi/jvmpi.html.]]
[30]
The Eclipse Foundation. Eclipse Homepage. http://www.eclipse.org.]]

Cited By

View all
  • (2023)A memory footprint optimization framework for Python applications targeting edge devicesJournal of Systems Architecture10.1016/j.sysarc.2023.102936142(102936)Online publication date: Sep-2023
  • (2023)Pattern-based circular reference detection in PythonScience of Computer Programming10.1016/j.scico.2023.102932227(102932)Online publication date: Apr-2023
  • (2023)Towards an understanding of memory leak patterns: an empirical study in PythonSoftware Quality Journal10.1007/s11219-023-09641-531:4(1303-1330)Online publication date: 17-Jun-2023
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

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
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 17 January 2007

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. dynamic
  2. garbage collection
  3. memory leak detection
  4. memory leaks
  5. runtime analysis

Qualifiers

  • Article

Conference

POPL07

Acceptance Rates

Overall Acceptance Rate 824 of 4,130 submissions, 20%

Upcoming Conference

POPL '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)25
  • Downloads (Last 6 weeks)5
Reflects downloads up to 09 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2023)A memory footprint optimization framework for Python applications targeting edge devicesJournal of Systems Architecture10.1016/j.sysarc.2023.102936142(102936)Online publication date: Sep-2023
  • (2023)Pattern-based circular reference detection in PythonScience of Computer Programming10.1016/j.scico.2023.102932227(102932)Online publication date: Apr-2023
  • (2023)Towards an understanding of memory leak patterns: an empirical study in PythonSoftware Quality Journal10.1007/s11219-023-09641-531:4(1303-1330)Online publication date: 17-Jun-2023
  • (2022)Exploit the Last Straw That Breaks Android Systems2022 IEEE Symposium on Security and Privacy (SP)10.1109/SP46214.2022.9833563(2230-2247)Online publication date: May-2022
  • (2021)Efficient heap monitoring tool for memory leak detection and root-cause analysis2021 IEEE International Conference on Big Data (Big Data)10.1109/BigData52589.2021.9671473(3020-3030)Online publication date: 15-Dec-2021
  • (2021)SoK: Secure Memory AllocationCryptology and Network Security10.1007/978-3-030-92548-2_20(372-391)Online publication date: 9-Dec-2021
  • (2021)Online Memory Leak Detection in the Cloud-Based InfrastructuresService-Oriented Computing – ICSOC 2020 Workshops10.1007/978-3-030-76352-7_21(188-200)Online publication date: 30-May-2021
  • (2020)Sound garbage collection for C using pointer provenanceProceedings of the ACM on Programming Languages10.1145/34282444:OOPSLA(1-28)Online publication date: 13-Nov-2020
  • (2020)Risk-Aware Leak Detection at Binary Level2020 IEEE 25th Pacific Rim International Symposium on Dependable Computing (PRDC)10.1109/PRDC50213.2020.00028(171-180)Online publication date: Dec-2020
  • (2020)Smartphone processor architecture, operations, and functions: current state-of-the-art and future outlook: energy performance trade-offThe Journal of Supercomputing10.1007/s11227-020-03312-z77:2(1377-1454)Online publication date: 16-May-2020
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media