On 21 okt 2009, at 02.18, Quincey Morris wrote:

When I set this ivar to nil. the results are:

(gdb) info gc-roots 0x2004f9340
Number of roots: 1
Root:
0 Kind: bytes rc: 1 Address: 0x0000000200543b40 Offset: 0x0000000000000008
 1 Kind: object  rc:   0  Address: 0x00000002004f9340  Class: Volume

So there's still a live pointer to your Volume instance in a block of (GC-controlled) memory at 200543b40+8. That block appears to be alive because it has a non-zero reference count.


Quincey is correct, and you can most likely figure out the last piece of this puzzle by using MallocStackLogging. In your executable in Xcode, or in the shell that launches your app, enable it by setting:

        MallocStackLogging=1

Then, once you've run "info gc-roots" to find the rooting reference, run malloc_history in a Terminal window (or in GDB using the "shell" command):

        malloc_history <PID> <ADR>

...where you replace PID and ADR with the pid of the app and the address of the rooting reference respectively.

The last entry in the output of malloc_history will be the allocation event for the rooting reference, typically allowing you to understand what's going on.

j o a r


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to