• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: info gc-roots interpretation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: info gc-roots interpretation


  • Subject: Re: info gc-roots interpretation
  • From: Joar Wingfors <email@hidden>
  • Date: Wed, 21 Oct 2009 08:20:45 -0700


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 (email@hidden)

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:
This email sent to email@hidden


References: 
 >info gc-roots interpretation (From: Nick Rogers <email@hidden>)
 >Re: info gc-roots interpretation (From: Quincey Morris <email@hidden>)

  • Prev by Date: GC Re: Questions about Nib Object Retention
  • Next by Date: Re: GC Re: Questions about Nib Object Retention
  • Previous by thread: Re: info gc-roots interpretation
  • Next by thread: Re: info gc-roots interpretation
  • Index(es):
    • Date
    • Thread