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 protected])

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 [email protected]

Reply via email to