when exit debugging of my program, it outputs several memory leaks. How do I
find which malloc() or "new" calls generated leaks?

it displays the leaks as follows (it doesn't display file/line of malloc
call).

{1247} normal block at 0x00A54D50, 33 bytes long.
Data: < 247040 > 00 32 34 37 30 34 30 00 CD CD CD CD CD CD CD CD


thanks in advance.

Re: memory leaks by Ivan

Ivan
Fri Nov 21 20:48:30 CST 2003

The Operative System (NT-Derivative only) has a built-in facility to track
heap allocations.
This facility is activated via
c:\>gflags -i YourImagename.exe +ust
Once the heap manager has been instructed to store the stack backtrace of
the allocations,
you can use umdh.exe to take a snapshot of the application
before and after you've exercised the application,
and then compare the results.

This is the command line help of UMDH

/////////////////////////////////////
MODE 3
creates / compares 2 dumps of heap allocations
prints stack backtraces whenever possible.

Usage example
-1- umdh.exe -snap _PID_ -file FirstDump.dat
-2- ... exercise the application
-3- umdh.exe -snap _PID_ -file SecondDump.dat
-4- umdh.exe -snapcmp FirstDump.dat SecondDump.dat [-l]

Options:

SNAPSHOT mode
-snap PID. Required. process id (decimal) of the application
-file FilePath. Required. path of the file where to store the snapshot

COMPARE mode
-snapcmd File1 File2.
Required. File1 and File2 are the path of the files with the snapshots
taken in the previous phase
-l.
Optional: includes line information (if available) in symbols
resolution
//////////////////////////////////

gflags.exe and umdh.exe comes from the standard debugger package.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"Hans Meier" <hans@meier.com> wrote in message
news:bpmb28$3s4$03$1@news.t-online.com...
> when exit debugging of my program, it outputs several memory leaks. How do
I
> find which malloc() or "new" calls generated leaks?
>
> it displays the leaks as follows (it doesn't display file/line of malloc
> call).
>
> {1247} normal block at 0x00A54D50, 33 bytes long.
> Data: < 247040 > 00 32 34 37 30 34 30 00 CD CD CD CD CD CD CD CD
>
>
> thanks in advance.
>
>