How to identify memory leaks?
Hello,
I want to check whether memory leaks exists in my prog. I use VS 2008 standard edition. I see that there is an in built debugger which makes life simpler to debug.
I came across this link
http://msdn.microsoft.com/en-us/libr...=VS.80%29.aspx
I followed the steps, but i am not able to get the line number and filename where memory is leaking. Only thing is it is dumping the memory leaks.
Now my question is whatever it displays, the block of memory, is that full memory leak??
I mean there are values like,
00 00 00 02 14 B2 CD 00.......
or
.... 00 14 00 CD CD CD CD
or full of zeros...
How do i identify which one is having memory leak? Whats the rule to identify based in this data which block is leaking.?
Suggestions and comments required urgently.
Thanks
Re: How to identify memory leaks?
Please, show the exact "memory leaks" message, not your own skipped version of it! :(
Re: How to identify memory leaks?
You can use _CrtDbgBreak in the watch window, to break at the block allocation that generated the leak. But you need to get a reproduceable scenario, with the same allocation numbers generating leaks for each run.
Re: How to identify memory leaks?
Re: How to identify memory leaks?
Here is an FAQ about how to find the source of memory leaks: http://www.codeguru.com/forum/showthread.php?t=499952.