|
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
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
Erwin Andreasen and Henner Zeller. LeakTracer. August 2003. http://www.andreasen.org/LeakTracer/
|
 |
2
|
|
| |
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
|
|
 |
6
|
|
| |
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
|
|
| |
12
|
|
 |
13
|
|
| |
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 , Michael I. Jordan, Bug isolation via remote program sampling, Proceedings of the ACM SIGPLAN 2003 conference on Programming language design and implementation, June 09-11, 2003, San Diego, California, USA
|
| |
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
|
|
| |
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 35
|
|
|
|
|
Chen Ding , Chengliang Zhang , Xipeng Shen , Mitsunori Ogihara, Gated memory control for memory monitoring, leak detection and garbage collection, Proceedings of the 2005 workshop on Memory system performance, June 12-12, 2005, Chicago, Illinois
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Xipeng Shen , Michael L. Scott , Chengliang Zhang , Sandhya Dwarkadas , Chen Ding , Mitsunori Ogihara, Analysis of input-dependent program behavior using active profiling, Proceedings of the 2007 workshop on Experimental computer science, p.5-es, June 13-14, 2007, San Diego, California
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Yan Tang , Yan Tang , Qi Gao , Qi Gao , Feng Qin , Feng Qin, LeakSurvivor: towards safely tolerating memory leaks for garbage-collected languages, USENIX 2008 Annual Technical Conference on Annual Technical Conference, p.307-320, June 22-27, 2008, Boston, Massachusetts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Xipeng Shen , Chengliang Zhang , Chen Ding , Michael L. Scott , Sandhya Dwarkadas , Mitsunori Ogihara, Analysis of input-dependent program behavior using active profiling, Experimental computer science on Experimental computer science, p.4-4, June 13-14, 2007, San Diego
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Joseph L. Greathouse , Ilya Wagner , David A. Ramos , Gautam Bhatnagar , Todd Austin , Valeria Bertacco , Seth Pettie, Testudo: Heavyweight security analysis via statistical sampling, Proceedings of the 2008 41st IEEE/ACM International Symposium on Microarchitecture, p.117-128, November 08-12, 2008
|
|
|
|
|
|
|
|
|
|
|