如何在Visual Studio 2015的Watch窗口中设置内存分配断点 [英] How do I set a memory-allocation breakpoint in the Watch window for visual studio 2015

查看:97
本文介绍了如何在Visual Studio 2015的Watch窗口中设置内存分配断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,



我使用_CrtDumpMemoryLeaks转储我的.exe中的内存泄漏

结果我获得了行号没有释放的字节大小。



我在visual studio 2012调试期间在我的观察窗口中使用{,, msvcr110d.dll} _crtBreakAlloc来查找发生泄漏的确切位置。



但对于visual studio 2015,我没有找到任何dll(msvcr140d.dll)以及安装。在visual studio 2015中是否有其他方法可以找到内存泄漏?



I am dumping the memory leaks in my .exe using _CrtDumpMemoryLeaks
As a result I am getting the line number and size of bytes that are not freed.

I was using {,,msvcr110d.dll}_crtBreakAlloc in my watch window during debugging in visual studio 2012 to find out the exact position where leak occurred.

But for visual studio 2015, I have not found any dll(msvcr140d.dll) along with installation. Is there some other way to find memory leaks in visual studio 2015?

推荐答案

请参阅此链接有关CRT的重构:http://blogs.msdn.com/b/vcblog/archive/2014 /06/10/the-great-crt-refactoring.aspx?PageIndex=2 [ ^ ]



有现在有三个库,根据上面的链接,堆函数在appcrt140 [d] .dll。
See this link about the refactoring of the CRT: http://blogs.msdn.com/b/vcblog/archive/2014/06/10/the-great-crt-refactoring.aspx?PageIndex=2[^]

There are now three libraries and according to the above link the heap functions are in appcrt140[d].dll.


以防万一其他人需要另一个解决方案,我发现对于Microsoft Visual Studio社区2015 ,该变量位于ucrtbased.dll:



(int *){,, ucrtbased.dll} __ crtBreakAlloc
Just in case someone else needs another solution, I found that for Microsoft Visual Studio Community 2015, the variable is located on ucrtbased.dll:

(int*){,,ucrtbased.dll}__crtBreakAlloc


这篇关于如何在Visual Studio 2015的Watch窗口中设置内存分配断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆