Low-overhead memory leak detection using adaptive statistical profiling

Author:

Hauswirth Matthias1,Chilimbi Trishul M.2

Affiliation:

1. University of Colorado at Boulder, Boulder, CO

2. Microsoft Research, Redmond, WA

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%).

Publisher

Association for Computing Machinery (ACM)

Reference20 articles.

1. Erwin Andreasen and Henner Zeller. LeakTracer. August 2003. http://www.andreasen.org/LeakTracer/ Erwin Andreasen and Henner Zeller. LeakTracer. August 2003. http://www.andreasen.org/LeakTracer/

2. A framework for reducing the cost of instrumented code

3. Hans Boehm Alan Demers and Mark Weiser. A garbage collector for C and C++. http://www.hpl.hp.com/personal/ Hans_Boehm/gc/ 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 Borland OptimizeIt Profiler. http://www.borland.com/optimizeit/optimizeit_profiler/index.html

5. A static analyzer for finding dynamic programming errors

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3