Re: Release vs. autorelease
Re: Release vs. autorelease
- Subject: Re: Release vs. autorelease
- From: Nick Zitzmann <email@hidden>
- Date: Mon, 12 Jan 2009 13:10:27 -0700
On Jan 12, 2009, at 12:37 PM, Mohan Parthasarathy wrote:
In places other than dealloc where memory needs to be released (e.g,
reassigning pointer to objects), is there a difference in doing
autorelease
or release of the object in terms of perfomance etc. ?
Yes, but only if you're creating lots of objects in a loop that is
going to do a lot of iterations. In this case, -release is more
responsible, since it frees up RAM for the next run through the loop,
whereas -autorelease will defer the release for later, and if you
don't create a nested autorelease pool (which you should do anyway in
this case), you'll experience a big memory bubble that will inflate &
burst, which is not a fun user experience if the user has less than 4
GB of physical RAM.
Nick Zitzmann
<http://www.chronosnet.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