Re: GC memory leak - what is it?
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