Tian,
In this case, the memory dump does not include line numbers. The
numbers in braces ({425}, {427}, {429}) are allocation numbers. This
means that the 425th, 427th and 429th allocations (using that allocator)
were leaked. These were just "normal blocks", so they didn't have
stored the source file and line number as "client blocks" often will.
If you can reliably reproduce the memory leak, and if it always is
the same allocation numbers, then you can set a conditional breakpoint
in the allocator for when the number is 425. Once the breakpoint is
reached, simply look in the call stack to determine where the allocation
was initiated.
If it is not predictably reproducible, then you'll have to do more
sleuthing. In the memory dump, only the first 16 bytes are displayed,
even though the leaked blocks are 84 bytes long each. If you set a
breakpoint in the code that produces these memory dumps, you can use the
memory pane to see the entire contents of the blocks. Perhaps in the
full 84 bytes, you can recognize the structure being leaked, and thereby
discover the origin.
Just from the 16 bytes displayed, there are some clues. It's
clear that after the first 8 bytes, there is a 4-byte pointer in the
leaked structures. In this case, all three of the pointers refer to
address 0x00A380F4. Also, following the pointer, there is an integer
with values 0, 2, and 1, (for allocations 425, 427, and 429,
respectively).
Good luck!
Quote:
> Hi All,
> When my debug version app exit, the debug console always display
> following information:
> pid 1120 : Detected memory leaks!
> pid 1120 : Dumping objects ->
> pid 1120 : {429} pid 1120 : normal block at 0x00A38AF8, 84 bytes
> long.
> pid 1120 : Data: < > 02 00 00 00 00 00 00 00 F4 80 A3 00
> 01 00 00 00
> pid 1120 : {427} pid 1120 : normal block at 0x00A38A70, 84 bytes
> long.
> pid 1120 : Data: < > 02 00 00 00 00 00 00 00 F4 80 A3 00
> 02 00 00 00
> pid 1120 : {425} pid 1120 : normal block at 0x00A389E8, 84 bytes
> long.
> pid 1120 : Data: < > 02 00 00 00 00 00 00 00 F4 80 A3 00
> 00 00 00 00
> pid 1120 : Object dump complete.
> I want to know:
> 1. What's name of the source code file related the line number?
> 2. How can I find which handle I forgot to release? that is, how
> to find the variable name of 0x00A38AF8, 0x00A38A70 and 0x00A389E8?
> Thanks in advance.
> Tian