刚刚看到一篇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下内存泄漏查找的工具(链接),但是没有很实际的衡量每个工具的局限。不过这回大家可以参考一下这篇文章针对这些工具的比较。
本文介绍在Solaris系统中使用Dmalloc工具检测内存泄漏的方法及其局限性,并对比了其他复杂工具如dbxRTC、Purify和Valgrind的功能。
300

被折叠的 条评论
为什么被折叠?



