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

skip to main content
10.1145/1542476.1542521acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

Efficiently and precisely locating memory leaks and bloat

Published: 15 June 2009 Publication History

Abstract

Inefficient use of memory, including leaks and bloat, remain a significant challenge for C and C++ developers. Applications with these problems become slower over time as their working set grows and can become unresponsive. At the same time, memory leaks and bloat remain notoriously difficult to debug, and comprise a large number of reported bugs in mature applications. Previous tools for diagnosing memory inefficiencies-based on garbage collection, binary rewriting, or code sampling-impose high overheads (up to 100X) or generate many false alarms.
This paper presents Hound, a runtime system that helps track down the sources of memory leaks and bloat in C and C++ applications. Hound employs data sampling, a staleness-tracking approach based on a novel heap organization, to make it both precise and efficient. Hound has no false positives, and its runtime and space overhead are low enough that it can be used in deployed applications. We demonstrate Hound's efficacy across a suite of synthetic benchmarks and real applications.

References

[1]
A. W. Appel and K. Li. Virtual memory primitives for user programs. In Proceedings of the Fourth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS '91), pages 96--107, 1991.
[2]
E. D. Berger, B. G. Zorn, and K. S. McKinley. Reconsidering custom memory allocation. In Proceedings of the 2002 ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA '02), pages 1--12, 2002.
[3]
M. D. Bond and K. S. McKinley. Bell: bit-encoding online memory leak detection. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS '06), pages 61--72, San Jose, CA, Oct. 2006.
[4]
M. D. Bond and K. S. McKinley. Tolerating memory leaks. In Proceedings of the 23rd Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2008), pages 109--126, Nashville, TN, Oct. 2008. ACM.
[5]
S. Cherem, L. Princehouse, and R. Rugina. Practical memory leak detection using guarded value-flow analysis. In Proceedings of the 2007 ACM SIGPLAN Conference on Programming language design and implementation (PLDI '07), pages 480--491, 2007.
[6]
D. Dhurjati and V. Adve. Efficiently detecting all dangling pointer uses in production servers. In Proceedings of the International Conference on Dependable Systems and Networks (DSN '06), pages 269--280, Washington, DC, USA, 2006. IEEE Computer Society.
[7]
R. Hastings and B. Joyce. Fast detection of memory leaks and access errors. In Proceedings of the Winter '92 USENIX conference, pages 125--136. USENIX Association, 1992.
[8]
M. Hauswirth and T. M. Chilimbi. Low-overhead memory leak detection using adaptive statistical profiling. In ASPLOS, pages 156--164, Boston, MA, Apr. 2004. ACM.
[9]
D. L. Heine and M. S. Lam. A practical flow-sensitive and context-sensitive C and C++ memory leak detector. In Proceedings of the ACM SIGPLAN 2003 conference on Programming Language Design and Implementation (PLDI '03), pages 168--181, 2003.
[10]
R. E. Jones and R. Lins. Garbage Collection: Algorithms for Automatic Dynamic Memory Management. Wiley, Chichester, July 1996.
[11]
M. Jump and K. S. McKinley. Cork: Dynamic memory leak detection for garbage-collected languages. In Proceedings of the 34th annual ACM SIGPLAN-SIGACT symposium on Principles of Programming Languages (POPL '07), pages 31--38, 2007.
[12]
P.-H. Kamp. Malloc(3) revisited. http://phk.freebsd.dk/pubs/malloc.pdf.
[13]
C. Lattner and V. Adve. Automatic pool allocation: improving performance by controlling data structure layout in the heap. In PLDI '05: Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation, pages 129--142, 2005.
[14]
D. Lea. A memory allocator. http://gee.cs.oswego.edu/dl/html/malloc.html, 1997.
[15]
C.-K. Luk, R. Cohn, R. Muth, H. Patil, A. Klauser, G. Lowney, S. Wallace, V. J. Reddi, and K. Hazelwood. Pin: building customized program analysis tools with dynamic instrumentation. In Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation (PLDI '05), pages 190--200, 2005.
[16]
V. B. Lvin, G. Novark, E. D. Berger, and B. G. Zorn. Archipelago: trading address space for reliability and security. In Proceedings of the 13th International Conference on Architectural Support for Programming Languages and Operating Systems, (ASPLOS '08), pages 115--124, Mar. 2008.
[17]
J. Maebe, M. Ronsse, and K. D. Bosschere. Precise detection of memory leaks. In Workshop on Dynamic Analysis (WODA 04), pages 25--31, 2004.
[18]
Microsoft TechNet, Microsoft Corporation. Memory Leak Diagnoser, Dec. 2007.
[19]
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), 2003.
[20]
Mozilla.org. Bugzilla@mozilla, 2008. {Online; accessed 12-March-2008}.
[21]
N. Nethercote and J. Seward. Valgrind: a framework for heavyweight dynamic binary instrumentation. In Proceedings of the ACM SIGPLAN 2007 Conference on Programming Language Design and Implementation (PLDI '07), pages 89--100, June 2007.
[22]
H. H. Nguyen and M. Rinard. Detecting and eliminating memory leaks using cyclic memory allocation. In Proceedings of the 6th International Symposium on Memory Management (ISMM '07), pages 15--30, 2007.
[23]
M. Orlovich and R. Rugina. Memory leak analysis by contradiction. In Proceedings of the 13th Annual Static Analysis Symposium (SAS '06), pages 405--424, 2006.
[24]
F. Qin, S. Lu, and Y. Zhou. SafeMem: Exploiting ECC-memory for detecting memory leaks and memory corruption during production runs. In Proceedings of the 11th International Symposium on High-Performance Computer Architecture (HPCA '05), volume 00, pages 291--302. IEEE Computer Society, 2005.
[25]
D. Rayside and L. Mendel. Object ownership profiling: a technique for finding and fixing memory leaks. In Proceedings of the 22nd IEEE/ACM international conference on Automated software engineering (ASE '07), pages 194--203, 2007.
[26]
N. Röjemo and C. Runciman. Lag, drag, void, and use: Heap profiling and space-efficient compilation revisited. In Proceedings of First International Conference on Functional Programming, pages 34--41, Philadelphia, PA, May 1996. ACM Press.
[27]
M. L. Seidl and B. G. Zorn. Segregating heap objects by reference behavior and lifetime. In Proceedings of the Eighth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS '98), pages 12--23, San Jose, CA, Oct. 1998.
[28]
R. Shaham, E. K. Kolodner, and S. Sagiv. Automatic removal of array memory leaks in Java. In Proceedings of the 9th International Conference on Compiler Construction (CC '00), pages 50--66, London, UK, 2000. Springer.
[29]
R. Shaham, E. Yahav, E. Kolodner, and M. Sagiv. Establishing local temporal heap safety properties with applications to compile-time memory management. In SAS '03: Proceedings of the 10th Annual Static Analysis Symposium, 2003.
[30]
Standard Performance Evaluation Corporation. SPEC2006. http://www.spec.org.
[31]
Y. Tang, Q. Gao, and F. Qin. LeakSurvivor: Towards safely tolerating memory leaks for garbage-collected languages. In Proceedings of the 2008 USENIX Annual Technical Conference (USENIX '08), pages 307--320, Boston, MA, June 2008.
[32]
L. Torvalds. Linux kernel mailing list post. http://lkml.org/lkml/2004/1/12/265, 1 2004.
[33]
T. Tsai, K. Vaidyanathan, and K. C. Gross. Low-overhead run-time memory leak detection and recovery. In Proceedings of the 12th Pacific Rim International Symposium on Dependable Computing (PRDC '06), pages 329--340. IEEE Computer Society, 2006.
[34]
G. Venkataramani, B. Roemer, Y. Solihin, and M. Prvulovic. Memtracker: Efficient and programmable support for memory access monitoring and debugging. In Proceedings of the 13th International Symposium on High-Performance Computer Architecture (HPCA'07), pages 273--284. IEEE Computer Society, 2007.
[35]
P. R. Wilson, M. S. Johnstone, M. Neely, and D. Boles. Dynamic storage allocation: A survey and critical review. In Proceedings of the International Workshop on Memory Management, volume 986, pages 1--116, Kinross, Scotland, Sept. 1995. Springer.
[36]
Y. Xie and A. Aiken. Context-and path-sensitive memory leak detection. In Proceedings of the 5th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering (ESAC/FSE '05), pages 115--125, 2005.
[37]
T. Yang, E. D. Berger, S. F. Kaplan, and J. E. B. Moss. CRAMM: Virtual memory support for garbage-collected applications. In 7th Symposium on Operating Systems Design and Implementation (OSDI'06), pages 103--116. USENIX Association, 2006.

Cited By

View all
  • (2021)Mixture of volumetric primitives for efficient neural renderingACM Transactions on Graphics10.1145/3450626.345986340:4(1-13)Online publication date: 19-Jul-2021
  • (2021)AcornACM Transactions on Graphics10.1145/3450626.345978540:4(1-13)Online publication date: 19-Jul-2021
  • (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

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
PLDI '09: Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation
June 2009
492 pages
ISBN:9781605583921
DOI:10.1145/1542476
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 44, Issue 6
    PLDI '09
    June 2009
    478 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1543135
    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: 15 June 2009

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. dynamic memory allocation
  2. heap profiling
  3. hound
  4. memory leak detection
  5. virtual compaction

Qualifiers

  • Research-article

Conference

PLDI '09
Sponsor:

Acceptance Rates

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

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

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

Other Metrics

Citations

Cited By

View all
  • (2021)Mixture of volumetric primitives for efficient neural renderingACM Transactions on Graphics10.1145/3450626.345986340:4(1-13)Online publication date: 19-Jul-2021
  • (2021)AcornACM Transactions on Graphics10.1145/3450626.345978540:4(1-13)Online publication date: 19-Jul-2021
  • (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)Programming and reasoning with partial observabilityProceedings of the ACM on Programming Languages10.1145/34282684:OOPSLA(1-28)Online publication date: 13-Nov-2020
  • (2020)Inter-theory dependency analysis for SMT string solversProceedings of the ACM on Programming Languages10.1145/34282604:OOPSLA(1-27)Online publication date: 13-Nov-2020
  • (2020)Fuzzing channel-based concurrency runtimes using types and effectsProceedings of the ACM on Programming Languages10.1145/34282544:OOPSLA(1-27)Online publication date: 13-Nov-2020
  • (2020)Knowing when to ask: sound scheduling of name resolution in type checkers derived from declarative specificationsProceedings of the ACM on Programming Languages10.1145/34282484:OOPSLA(1-28)Online publication date: 13-Nov-2020
  • (2020)FlowCFL: generalized type-based reachability analysis: graph reduction and equivalence of CFL-based and type-based reachabilityProceedings of the ACM on Programming Languages10.1145/34282464:OOPSLA(1-29)Online publication date: 13-Nov-2020
  • (2020)Dataflow-based pruning for speeding up superoptimizationProceedings of the ACM on Programming Languages10.1145/34282454:OOPSLA(1-24)Online publication date: 13-Nov-2020
  • (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
  • 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