Solaris上的Dmalloc

本文介绍在Solaris系统中使用Dmalloc工具检测内存泄漏的方法及其局限性,并对比了其他复杂工具如dbxRTC、Purify和Valgrind的功能。

刚刚看到一篇SDN的文章,是关于在Solaris上使用Dmalloc工具检测内存泄漏的问题:

http://developers.sun.com/solaris/articles/dmalloc_solaris.html

很高兴看到Dmalloc能够在Solaris + Sun Studio的环境下可以使用,虽然它也有一些局限,但还是非常有用:

- Dmalloc can detect only memory-related problems in the heap, not in the stack, and not in static memory.

- It can detect bugs only when the memory is allocated with malloc(), not by other means, such as sbrk() or mmap().  

- It cannot detect the following problems, which can be detected by more complicated tools, such as dbx RTC, Purify, and Valgrind, that do much more than replace malloc, realloc, and free:

- Checking stack memory

- Reading from or writing to unallocated memory

- Reading from allocated but uninitialized memory

- Writing to read-only memory

之前Hunter Li和我也一同总结过Solaris下内存泄漏查找的工具(链接),但是没有很实际的衡量每个工具的局限。不过这回大家可以参考一下这篇文章针对这些工具的比较。 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值