使用WinDug查内存泄露
来源:互联网 发布:怎么开淘宝店铺步骤 编辑:程序博客网 时间:2024/06/07 03:11
在C++的开发中经常会出现内存泄露,尤其服务开发,一个很小的内存泄露就可以导致很严重的问题。最终我们的程序会因以下两个错误崩溃。1. The application has no enough resource to display。2. The application crash with a log like "memory allocation failed"。
Windug可以很方便的解决这个问题。
第一:配置Symbol File Path。
Configure the symbol file path to the Microsoft symbol server。SRV*c:\symbols*http://msdl.microsoft.com/download/symbols”
第二:配置Source File Path。
Add your program EXE/DLL PDB (program database) path to the symbol file path.(exe或dll所在的绝对路径)
第三:配置操作系统的标志,以便用户堆栈跟踪有内存泄漏的进程。
Gflags.exe -i excel.exe +ust 备注:excel 为要监测的进程名称 GFlags.exe在Windug的安装目录下:我的是C:\Program Files\Debugging Tools for Windows (x86) 在运行该命令前需要cd到当前路径下,命令是cd C:\Program Files\Debugging Tools for Windows (x86)
第四:用Windug Attach到该进程,程序运行结束后Windug 的Command窗口会提示有内存泄露,如图:
如图有两处内存泄露,此时可以在泄露的内存地址上进行分析。
第五:分析输入如下指令。!heap -p -a 0x021F0040
第六:结果分析
在OnBnClickedButtonNewmemory的函数中存在内存泄露。以上结果仅供参考
- 使用WinDug查内存泄露
- 查内存泄露
- 查C#的内存泄露
- 重载new, 查内存泄露
- 内存泄露检测工具使用
- VS环境下查内存泄露
- 使用HookLogger调试内存泄露
- javascript 内存泄露工具使用
- javascript 内存泄露工具使用
- 使用BoundsChecker查找内存泄露
- 使用Valgrind 查找内存泄露
- javascript 内存泄露工具使用
- javascript 内存泄露工具使用
- javascript 内存泄露工具使用
- 使用_CrtSetDbgFlag检测内存泄露
- 使用_CrtSetDbgFlag检测内存泄露
- 使用_CrtSetDbgFlag检测内存泄露
- javascript 内存泄露工具使用
- Swift Compiler Error Binary oprator '+' cannot be applied to operands of type 'UInt16' and 'UInt8'
- 设计模式--装饰模式(Decorator)
- hdu 2883 kebab
- 初步探索Log4j
- LeetCode Binary Tree Zigzag Level Order Traversal
- 使用WinDug查内存泄露
- STM32之系统重启
- GraphicsMagick和im4java按比例压缩图片
- 20150706
- C#读写txt文件的两种方法介绍
- windows下如何查看端口占用的程序
- 从ViewRootImpl类分析View绘制的流程
- 欢迎使用CSDN-markdown编辑器
- openwebmail