PDA

View Full Version : memory leak problem


isp
11-17-2005, 04:09 PM
I have a memory leak that's been bothering me for a while. A strange thing is that this is only detected if I build with multiple thread settings. Single thread settings do not detect this memory leak. :confused: Here is the output in the debug window.

Dumping objects ->
{979} normal block at 0x00FB97A0, 4 bytes long.
Data: <. > 2E 0A 00 00

Normally the memory dump displays the file name and the line number, but this does show this info. Does anyone know what {979} mean? Also, what are some of the ways to track down this memory leak?

ggambett
11-17-2005, 04:30 PM
Maybe it's the allocation number? I once used _CrtSomething to debug a similar problem. There IS a way to make the allocator trigger a breakpoint when it gets the Nth memory allocation request, so if that is indeed the allocation number, you can get a breakpoint exactly when it's being allocated.

vjvj
11-17-2005, 05:29 PM
Yes, it most likely is the allocation number. I would run it a few times to make sure that it's consistently the same number, then set up a breakpoint to break on that allocation number. The docs should explain how to do this, there is a line of code you'll need to add to your app to trap it.

DGuy
11-17-2005, 05:34 PM
Search MSDN.COM for _CrtSetBreakAlloc().

HTH

isp
11-17-2005, 06:59 PM
Thank you guys! It was the allocation number. No more leaks!

thanks