• 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: GC memory leak - what is it?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GC memory leak - what is it?


  • Subject: Re: GC memory leak - what is it?
  • From: Rippit the Ogg Frog <email@hidden>
  • Date: Mon, 04 Jan 2010 12:50:13 -0800



email@hidden wrote:
A recent post mentioned the concept of GC memory leakage.

How is is this defined? Is it merely a failure to nil out a rooted reference?

Yes. If you hold a reference to memory you don't need anymore, you have a leak.


I've gotten into huge flamewars over this, but I'm convinced of its truth.

Consider a Java Document Object Model tree. Every node holds a reference to its parent and all of its children. If you hold a reference to any node in the tree, you prevent the entire tree from being collected.

If you can't be sure that some other code will nil out your references, then nil them out yourself.

Rippit the Ogg Frog
email@hidden
http://www.oggfrog.com/
_______________________________________________

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: 
 >GC memory leak - what is it? (From: "email@hidden" <email@hidden>)

  • Prev by Date: Re: GC memory leak - what is it?
  • Next by Date: Re: Custom NSFormatter classes
  • Previous by thread: Re: GC memory leak - what is it?
  • Next by thread: Turn off font hinting?
  • Index(es):
    • Date
    • Thread