Low-overhead memory leak detection using adaptive statistical profiling

ASPLOS XI Pub Date : 2004-10-07 DOI:10.1145/1024393.1024412
Matthias Hauswirth, Trishul M. Chilimbi
{"title":"Low-overhead memory leak detection using adaptive statistical profiling","authors":"Matthias Hauswirth, Trishul M. Chilimbi","doi":"10.1145/1024393.1024412","DOIUrl":null,"url":null,"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%).","PeriodicalId":344295,"journal":{"name":"ASPLOS XI","volume":"3 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2004-10-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"254","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"ASPLOS XI","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/1024393.1024412","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 254

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%).
使用自适应统计分析的低开销内存泄漏检测
采样已经成功地用于识别性能优化机会。我们希望应用类似的技术来检查程序的正确性。不幸的是,采样对不经常执行的代码提供了很差的覆盖,而这些代码往往潜伏着bug。我们描述了一种自适应分析方案,该方案通过以与执行频率成反比的速率对代码段的执行进行抽样来解决这个问题。为了验证我们的想法,我们实现了一种新的内存泄漏检测工具SWAT。SWAT跟踪程序分配/释放以构建堆模型,并使用我们的自适应分析基础设施以低开销监视这些对象的负载/存储。SWAT将“过时”的对象报告为“长时间”未被访问的泄漏。这允许它查找在当前程序执行期间出现的所有泄漏。由于SWAT具有较低的运行时开销(5%)和较低的空间开销(大多数情况下为10%,通常低于5%),因此它可以用于跟踪需要几天才能显示的生产代码中的泄漏。除了识别泄漏内存的分配之外,SWAT还公开程序最后访问泄漏数据的位置,这有助于调试和修复泄漏。在过去的18个月里,微软的几个产品小组已经使用了SWAT,并且在检测泄漏方面被证明是有效的,并且误报率很低(10%)。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信