有哪些工具可以帮助查找句柄的内存泄漏?
有哪些工具可以帮助查找句柄的内存泄漏? 我有一个 file.exe 和一个 inproc-server dll,它正在使用 file.exe。每次完成操作时,我都会发生大约 10 次内存泄漏。
What tools exist to help finding memory leaks for handles?
I have a file.exe and an inproc-server dll, which is using file.exe. I have about 10 memory leaks of handles evertyime it completes its operation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
进程资源管理器 (http://technet.microsoft.com/en-us/sysinternals/bb896653< /a>) 是 SysInternals 工具之一,可用于显示程序已分配的句柄。您必须将下部窗格视图配置为显示句柄才能看到它们。它告诉您手柄的类型,这可能有助于找到泄漏源。它不会告诉您分配路径,但当其他工具也无法检测到泄漏时它仍然很有用。
我还使用 DevPartnerStudio 成功地发现了很多漏洞。 (http://www.microfocus.com/products/micro- focus-developer/devpartner/index.aspx)。它确实有报告错误泄漏的倾向,因此您必须调整设置以确保获得准确的结果。这是一个非常好的产品,我总是建议在 Windows 上进行 C++ 开发时购买它。
Process Explorer (http://technet.microsoft.com/en-us/sysinternals/bb896653) is one of the SysInternals tools that you can use to show the handles that a program has allocated. You have to configure the lower pane view to show handles in order to see them. It tells you the type of handle, which may help in finding the source of the leak. It won't tell you an allocation path, but it is still useful when other tools also can't detect the leaks.
I've also used DevPartnerStudio successfully to find a lot of leaks. (http://www.microfocus.com/products/micro-focus-developer/devpartner/index.aspx). It does have a tendency to report false leaks, so you have to play with the settings to make sure you're getting accurate results. It is a very good product and I always suggest buying it when doing C++ development on Windows.