Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/1993498.1993530acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

LeakChaser: helping programmers narrow down causes of memory leaks

Published: 04 June 2011 Publication History

Abstract

In large programs written in managed languages such as Java and C#, holding unnecessary references often results in memory leaks and bloat, degrading significantly their run-time performance and scalability. Despite the existence of many leak detectors for such languages, these detectors often target low-level objects; as a result, their reports contain many false warnings and lack sufficient semantic information to help diagnose problems. This paper introduces a specification-based technique called LeakChaser that can not only capture precisely the unnecessary references leading to leaks, but also explain, with high-level semantics, why these references become unnecessary.
At the heart of LeakChaser is a three-tier approach that uses varying levels of abstraction to assist programmers with different skill levels and code familiarity to find leaks. At the highest tier of the approach, the programmer only needs to specify the boundaries of coarse-grained activities, referred to as transactions. The tool automatically infers liveness properties of these transactions, by monitoring the execution, in order to find unnecessary references. Diagnosis at this tier can be performed by any programmer after inspecting the APIs and basic modules of a program, without understanding of the detailed implementation of these APIs. At the middle tier, the programmer can introduce application-specific semantic information by specifying properties for the transactions. At the lowest tier of the approach is a liveness checker that does not rely on higher-level semantic information, but rather allows a programmer to assert lifetime relationships for pairs of objects. This task could only be performed by skillful programmers who have a clear understanding of data structures and algorithms in the program.
We have implemented LeakChaser in Jikes RVM and used it to help us diagnose several real-world leaks. The implementation incurs a reasonable overhead for debugging and tuning. Our case studies indicate that the implementation is powerful in guiding programmers with varying code familiarity to find the root causes of several memory leaks---even someone who had not studied a leaking program can quickly find the cause after using LeakChaser's iterative process that infers and checks properties with different levels of semantic information.

References

[1]
The Jikes Research Virtual Machine, 2011. http://jikesrvm.org.
[2]
JML Reference Manual, 2010. http://www.jmlspecs.org.
[3]
E. E. Aftandilian and S. Z. Guyer. GC Assertions: Using the garbage collector to check heap properties. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 235--244, 2009.
[4]
E. Altman, M. Arnold, S. Fink, and N. Mitchell. Performance analysis of idle programs. In ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 739--753, 2010.
[5]
M. Arnold, M. Vechev, and E. Yahav. QVM: An efficient runtime for detecting defects in deployed systems. In ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 143--162, 2008.
[6]
S. M. Blackburn and K. S. McKinley. Immix: a mark-region garbage collector with space efficiency, fast collection, and mutator performance. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 22--32, 2008.
[7]
VanDrunen, von Dincklage, and Wiedermann}dacapo-oopsla06-fullS. 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, A. Phansalkar, D. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo benchmarks: Java benchmarking development and analysis. In ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 169--190, 2006.
[8]
M. D. Bond and K. S. McKinley. Bell: Bit-encoding online memory leak detection. In International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), pages 61--72, 2006.
[9]
M. D. Bond and K. S. McKinley. Leak pruning. In International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), pages 277--288, 2009.
[10]
M. D. Bond and K. S. McKinley. Tolerating memory leaks. In ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 109--126, 2008.
[11]
J. Burnim and K. Sen. Asserting and checking determinism for multithreaded programs. In ACM SIGSOFT International Symposium on the Foundations of Software Engineering (FSE), pages 3--12, 2009.
[12]
J. Burnim and K. Sen. Determin: Inferring likely deterministic specifications of multithreaded programs. In International Conference on Software Engineering (ICSE), pages 415--424, 2010.
[13]
CA Technologies. CA Wily Introscope LeakHunter. www.ca.com/ us/application-management.aspx.
[14]
J. Clause and A. Orso. Leakpoint: pinpointing the causes of memory leaks. In International Conference on Software Engineering (ICSE), pages 515--224, 2010.
[15]
B. Dufour, B. G. Ryder, and G. Sevitsky. A scalable technique for characterizing the usage of temporaries in framework-intensive Java applications. In ACM SIGSOFT International Symposium on the Foundations of Software Engineering (FSE), pages 59--70, 2008.
[16]
ej-technologies GmbH. JProfiler. www.ej-technologies.com.
[17]
R. Hastings and B. Joyce. Purify: A tool for detecting memory leaks and access errors in C and C programs. In Winter 1992 USENIX Conference, pages 125--138, 1992
[18]
M. Hauswirth and T. M. Chilimbi. Low-overhead memory leak detection using adaptive statistical profiling. In International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), pages 156--164, 2004.
[19]
hertz-toplas06M. Hertz, S. M. Blackburn, J. E. B. Moss, K. S. McKinley, and D. Stefanović. Generating object lifetime traces with Merlin. ACM Transactions on Programming Languages and Systems (TOPLAS), 28 (3): 476--516, 2006.
[20]
M. Jump and K. S. McKinley. Cork: Dynamic memory leak detection for garbage-collected languages. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pages 31--38, 2007.
[21]
N. Mitchell. The runtime structure of object ownership. In European Conference on Object-Oriented Programming (ECOOP), pages 74--98, 2006.
[22]
N. Mitchell and G. Sevitsky. The causes of bloat, the limits of health. In ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 245--260, 2007.
[23]
N. Mitchell and G. Sevitsky. Leakbot: An automated and lightweight tool for diagnosing memory leaks in large Java applications. In European Conference on Object-Oriented Programming (ECOOP), pages 351--377, 2003.
[24]
N. Mitchell, G. Sevitsky, and H. Srinivasan. Modeling runtime behavior in framework-based applications. In European Conference on Object-Oriented Programming (ECOOP), pages 429--451, 2006.
[25]
N. Mitchell, E. Schonberg, and G. Sevitsky. Making sense of large heaps. In European Conference on Object-Oriented Programming (ECOOP), pages 77--97, 2009.
[26]
N. Mitchell, E. Schonberg, and G. Sevitsky. Four trends leading to Java runtime bloat. IEEE Software, 27 (1): 56--63, 2010.
[27]
G. Novark, E. D. Berger, and B. G. Zorn. Efficiently and precisely locating memory leaks and bloat. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 397--407, 2009.
[28]
Quest Software. JProbe. www.quest.com/jprobe.
[29]
D. Rayside and L. Mendel. Object ownership profiling: A technique for finding and fixing memory leaks. In International Conference on Automated Software Engineering (ASE), pages 194--203, 2007.
[30]
C. Reichenbach, N. Immerman, Y. Smaragdakis, E. Aftandilian, and S. Z. Guyer. What can the GC compute efficiently? A language for heap assertions at GC time. In ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 256--269, 2010.
[31]
O. Shacham, M. Vechev, and E. Yahav. Chameleon: Adaptive selection of collections. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 408--418, 2009.
[32]
A. Shankar, M. Arnold, and R. Bodik. Jolt: Lightweight dynamic analysis and removal of object churn. In ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 127--142, 2008.
[33]
Y. Tang, Q. Gao, and F. Qin. LeakSurvivor: Towards safely tolerating memory leaks for garbage-collected languages. In The USENIX Anual Technical Conference (USENIX), pages 307--320, 2008.
[34]
The Standard Performance Evaluation Corporation. SPECjvm98 Benchmark Set. http://www.spec.org/jvm98/.
[35]
M. Vechev, E. Yahav, and G. Yorsh. PHALANX: Parallel checking of expressive heap assertions. In International Symposium on Memory Management (ISMM), pages 41--50, 2010.
[36]
G. Xu and A. Rountev. Precise memory leak detection for Java software using container profiling. In International Conference on Software Engineering (ICSE), pages 151--160, 2008.
[37]
G. Xu and A. Rountev. Detecting inefficiently-used containers to avoid bloat. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 160--173, 2010.
[38]
G. Xu, M. Arnold, N. Mitchell, A. Rountev, and G. Sevitsky. Go with the flow: Profiling copies to find runtime bloat. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 419--430, 2009.
[39]
Xu, Mitchell, Arnold, Rountev, Schonberg, and Sevitsky}xu-pldi10-DataStructureG. Xu, N. Mitchell, M. Arnold, A. Rountev, E. Schonberg, and G. Sevitsky. Finding low-utility data structures. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 174--186, 2010.
[40]
Xu, Mitchell, Arnold, Rountev, and Sevitsky}xu-foser10G. Xu, N. Mitchell, M. Arnold, A. Rountev, and G. Sevitsky. Software bloat analysis: Finding, removing, and preventing performance problems in modern large-scale object-oriented applications. In ACM SIGSOFT FSE/SDP Workshop on the Future of Software Engineering Research, 2010.

Cited By

View all
  • (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)OJXPerfProceedings of the 44th International Conference on Software Engineering10.1145/3510003.3510083(1558-1570)Online publication date: 21-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
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PLDI '11: Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation
June 2011
668 pages
ISBN:9781450306638
DOI:10.1145/1993498
  • General Chair:
  • Mary Hall,
  • Program Chair:
  • David Padua
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 46, Issue 6
    PLDI '11
    June 2011
    652 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1993316
    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: 04 June 2011

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. leakchaser
  2. memory leak detection
  3. object lifetime assertions

Qualifiers

  • Research-article

Conference

PLDI '11
Sponsor:

Acceptance Rates

Overall Acceptance Rate 406 of 2,067 submissions, 20%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)32
  • Downloads (Last 6 weeks)3
Reflects downloads up to 03 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (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)OJXPerfProceedings of the 44th International Conference on Software Engineering10.1145/3510003.3510083(1558-1570)Online publication date: 21-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
  • (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)SAVERProceedings of the ACM/IEEE 42nd International Conference on Software Engineering10.1145/3377811.3380323(271-283)Online publication date: 27-Jun-2020
  • (2020)Do Memories Haunt You? An Automated Black Box Testing Approach for Detecting Memory Leaks in Android AppsIEEE Access10.1109/ACCESS.2020.29665228(12217-12231)Online publication date: 2020
  • (2020)A comprehensive study on software aging across android versions and vendorsEmpirical Software Engineering10.1007/s10664-020-09838-3Online publication date: 30-Jun-2020
  • (2019)Detection of suspicious time windows in memory monitoringProceedings of the 16th ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes10.1145/3357390.3361025(95-104)Online publication date: 21-Oct-2019
  • (2019)Analyzing Data Structure Growth Over Time to Facilitate Memory Leak DetectionProceedings of the 2019 ACM/SPEC International Conference on Performance Engineering10.1145/3297663.3310297(273-284)Online publication date: 4-Apr-2019
  • (2019)Analysis of cache behaviour and software optimizations for faster on-chip network simulationsInternational Journal of System Assurance Engineering and Management10.1007/s13198-019-00799-5Online publication date: 14-May-2019
  • Show More Cited By

View Options

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