在VS C++ 6.0中,哪些调试工具适合查找内存泄漏的位置
In VS C++ 6.0, what debug tools are good to find where memory is leaking?
我的程序最终消耗了所有内存并崩溃...浏览代码,我找不到任何突出的东西可以做到这一点。
你能修改代码以使用 malloc
和 free
的调试版本吗?如果是,请检查_malloc_dbg和_free_dbg。
(您可以基于这些函数编写自己的new
和delete
运算符。
我记得VS 6.0没有_realloc_dbg
.
#ifdef _DEBUG
#define _CRTDBG_MAP_ALLOC 1
#include <Crtdbg.h>
#define malloc(size) _malloc_dbg(size,_CLIENT_BLOCK,__FILE__,__LINE__)
#define free(addr) _free_dbg(addr,_CLIENT_BLOCK)
#endif
你可以试试 BoundsChecker(现在是 DevPartner): http://www.microfocus.com/products/micro-focus-developer/devpartner/index.aspx
您将能够在代码中看到内存泄漏、接口泄漏和其他问题。
根据泄漏的类型,您可以使用umdh或debugdiag作为简单的工具,否则我会推荐windbg。所有这些都是免费的,并且是Windows调试工具的一部分,您可以Google以获取有关所有这些工具的教程。在windbg中自动查找泄漏的命令是!heap -l。
相关文章:
- 查找自动生成键并具有线性内存消耗的小型关联数组
- 需要帮助查找内存泄漏
- 可视化 使用 VS Code 查找C++应用程序中的内存泄漏
- 内存泄漏如何查找和删除
- 使用一个内存集数组和单个堆栈在 O(n) 中查找数组的下一个更大元素
- 在Visual Studio中查找非法内存访问
- 尝试在我的 C++ 代码中查找内存泄漏
- 需要帮助查找内存泄漏
- C++constexpr数组查找:内存开销?其他问题
- C++ 查找内存泄漏
- 在VS C++ 6.0中,哪些调试工具适合查找内存泄漏的位置
- 在没有第三方工具/项目的情况下,在 MFC C++发布版本中查找内存泄漏
- C++:查找内存映射文件的瓶颈
- 如何查找内存映射文件的流指针(使用boost)
- 在没有DOS、Windows、Linux的情况下在引导中查找内存大小
- 查找内存泄漏的最佳解决方案
- 使用计数器手动查找内存泄漏
- 如何使用GDB来查找内存地址对应的函数
- 如何在C++代码/项目中查找内存泄漏
- 需要帮助查找内存泄漏