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

skip to main content
article

Low-overhead memory leak detection using adaptive statistical profiling

Published: 07 October 2004 Publication History

Abstract

Sampling has been successfully used to identify performance optimization opportunities. We would like to apply similar techniques to check program correctness. Unfortunately, sampling provides poor coverage of infrequently executed code, where bugs often lurk. We describe an adaptive profiling scheme that addresses this by sampling executions of code segments at a rate inversely proportional to their execution frequency. To validate our ideas, we have implemented SWAT, a novel memory leak detection tool. SWAT traces program allocations/ frees to construct a heap model and uses our adaptive profiling infrastructure to monitor loads/stores to these objects with low overhead. SWAT reports 'stale' objects that have not been accessed for a 'long' time as leaks. This allows it to find all leaks that manifest during the current program execution. Since SWAT has low runtime overhead (‹5%), and low space overhead (‹10% in most cases and often less than 5%), it can be used to track leaks in production code that take days to manifest. In addition to identifying the allocations that leak memory, SWAT exposes where the program last accessed the leaked data, which facilitates debugging and fixing the leak. SWAT has been used by several product groups at Microsoft for the past 18 months and has proved effective at detecting leaks with a low false positive rate (‹10%).

References

[1]
Erwin Andreasen and Henner Zeller. LeakTracer. August 2003. http://www.andreasen.org/LeakTracer/
[2]
Matthew Arnold and Barbara Ryder. A framework for reducing the cost of instrumented code. In ACM SIGPLAN Conference on Programming Languages Design and Implementation (PLDI), 2001.
[3]
Hans Boehm, Alan Demers, and Mark Weiser. A garbage collector for C and C++. http://www.hpl.hp.com/personal/ Hans_Boehm/gc/
[4]
Borland OptimizeIt Profiler. http://www.borland.com/optimizeit/optimizeit_profiler/index.html
[5]
William R. Bush, Jonathan D. Pincus, and David J. Sielaff. A static analyzer for finding dynamic programming errors. In Software Practice and Experience, 2000; 30:775-802.
[6]
Trishul M. Chilimbi and Martin Hirzel. Dynamic Hot Data Stream Prefetching for General-Purpose Programs. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 199--209, June 2002.
[7]
Jeremy Dion and Louis Monier. ThirdDegree. http://research.compaq.com/wrl/projects/om/third.html
[8]
EJ-technologies' JProfiler. http://www.ej-technologies.com/products/jprofiler/overview.html
[9]
GreatCircle. http://www.geodesic.com/
[10]
R. Hastings and B. Joyce. Purify: Fast detection of memory leaks and access errors. In Proceedings of the Winter USENIX Conference, pages 125--136, 1992.
[11]
David L. Heine and Monica S. Lam. A Practical Flow-Sensitive and Context-Sensitive C and C++ Memory Leak Detector. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), 2003.
[12]
Martin Hirzel, Amer Diwan, and Antony Hosking. On the Usefulness of Liveness for Garbage Collection and Leak Detection. In European Conference on Object-Oriented Programming (ECOOP), pages 181--206, June 2001.
[13]
Martin Hirzel and Amer Diwan. On the Type Accuracy of Garbage Collection. In International Symposium on Memory Management (ISMM), pages 1--11, October 2000.
[14]
Martin Hirzel and Trishul M. Chilimbi. Bursty Tracing: A Framework for Low-Overhead Temporal Profiling. In 4th Workshop on Feedback-Directed and Dynamic Optimization (FDDO), pages 117--126, December 2001.
[15]
Ben Liblit, Alex Aiken, Alice X. Zheng, and Michael I. Jordan. Bug Isolation via Remote Program Sampling. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), June 2003.
[16]
Paul Moeller. Win32 Java Heap Inspector. 1998. http://www.geocities.com/moellep/debug/HeapInspector.html
[17]
Parasoft Insure++. http://www.parasoft.com/products/insure/
[18]
Quest jProbe Memory Debugger. http://www.quest.com/jprobe/debugger.asp
[19]
Stefan Savage, Michael Burrows, Greg Nelson, Patrick Sobalvarro, and Thomas Anderson. Eraser: A Dynamic Race Detector for Multi-Threaded Programs. In ACM Transactions on Computer Systems, 15(4): 391--411, November 1997.
[20]
A. Srivastava, A. Edwards, and H. Vo. Vulcan: Binary transformation in a distributed environment. In Microsoft Research Tech Report, MSR-TR-2001-50, 2001.
[21]
Benjamin Zorn and Paul Hilfinger. A memory allocation profiler for C and Lisp programs. In Proceedings of the Summer USENIX Conference, pages 223--237, 1988.

Cited By

View all
  • (2024)Evaluating the Effectiveness of Size-Limited Execution Trace with Near-Omniscient DebuggingScience of Computer Programming10.1016/j.scico.2024.103117(103117)Online publication date: Apr-2024
  • (2024)Survey of Techniques to Detect Common Weaknesses in Program BinariesCyber Security and Applications10.1016/j.csa.2024.100061(100061)Online publication date: May-2024
  • (2024)SFLVis: visual analysis of software fault localizationJournal of Visualization10.1007/s12650-024-00979-x27:4(585-602)Online publication date: 2-Apr-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 39, Issue 11
ASPLOS '04
November 2004
283 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/1037187
Issue’s Table of Contents
  • cover image ACM Conferences
    ASPLOS XI: Proceedings of the 11th international conference on Architectural support for programming languages and operating systems
    October 2004
    296 pages
    ISBN:1581138040
    DOI:10.1145/1024393
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: 07 October 2004
Published in SIGPLAN Volume 39, Issue 11

Check for updates

Author Tags

  1. low-overhead monitoring
  2. memory leaks
  3. runtime analysis

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)47
  • Downloads (Last 6 weeks)4
Reflects downloads up to 20 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Evaluating the Effectiveness of Size-Limited Execution Trace with Near-Omniscient DebuggingScience of Computer Programming10.1016/j.scico.2024.103117(103117)Online publication date: Apr-2024
  • (2024)Survey of Techniques to Detect Common Weaknesses in Program BinariesCyber Security and Applications10.1016/j.csa.2024.100061(100061)Online publication date: May-2024
  • (2024)SFLVis: visual analysis of software fault localizationJournal of Visualization10.1007/s12650-024-00979-x27:4(585-602)Online publication date: 2-Apr-2024
  • (2021)A dynamic approach to detecting, eliminating and fixing memory leaksJournal of Combinatorial Optimization10.1007/s10878-019-00398-x42:3(409-426)Online publication date: 1-Oct-2021
  • (2020)Lightweight memory tracing for hot data identificationCluster Computing10.1007/s10586-020-03130-123:3(2273-2285)Online publication date: 1-Sep-2020
  • (2020)A Logging Overhead Optimization Method Based on Anomaly Detection ModelHuman Centered Computing10.1007/978-3-030-70626-5_37(349-359)Online publication date: 14-Dec-2020
  • (2019)Profile-guided code identification and hardening using return oriented programmingJournal of Information Security and Applications10.1016/j.jisa.2019.10236448(102364)Online publication date: Oct-2019
  • (2018)Wireless protocol validation under uncertaintyFormal Methods in System Design10.1007/s10703-017-0309-453:1(33-53)Online publication date: 1-Aug-2018
  • (2017)Lightweight data race detection for production runsProceedings of the 26th International Conference on Compiler Construction10.1145/3033019.3033020(11-21)Online publication date: 5-Feb-2017
  • (2017)QDIME: QoS-Aware Dynamic Binary Instrumentation2017 IEEE 25th International Symposium on Modeling, Analysis, and Simulation of Computer and Telecommunication Systems (MASCOTS)10.1109/MASCOTS.2017.19(132-142)Online publication date: Sep-2017
  • 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