开发者

Conditional breakpoint when heap > some limit

Is it possible to break into debugger when the allocated memory of attached-to process becomes bigger than a certain value?

Preferrably using Visu开发者_开发问答al Studio 2005, but other IDE's/debuggers are an option.


There is no direct way to do it. Alternative is to set ordinary breakpoint somewhere inside CRT allocation code, and set it to break when the hit count is multiple of say 2000. You'll get to wanted state quickly enough.


I don't know of any direct way in Visual Studio, but you could use ProcDump to create a crash dump when the Memory commit threshold reaches a certain value (-m option).

You would then need to use WinDbg (part of the Windows debugging tools) to inspect the heap.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜