Re: NSObject Foundation tool memory issue?
Re: NSObject Foundation tool memory issue?
- Subject: Re: NSObject Foundation tool memory issue?
- From: Nick Zitzmann <email@hidden>
- Date: Thu, 8 Dec 2005 16:21:50 -0700
On Dec 8, 2005, at 4:05 PM, Lee Cullens wrote:
This all begs the question of using [object release] at all with
autoreleased objects (I know - my density is showing).
You shouldn't; you should keep all retains and releases balanced.
Should I try to minimize my memory footprint with nested
autorelease pools alone and forget about specific object releases?
That depends on how long the object is going to stay in use. I try to
avoid autoreleasing objects unless I know the pool is going to be
popped soon after I'm done with the object, because autoreleasing
objects is expensive compared to simply releasing them.
By the time I get to the third "opResult =" I have two unreferenced
objects that would have been memory leaks before the advent of
autoreleasePool. Does the autorelease mechanism decrement the
retain count when I reuse the reference variable?
You can reuse the reference variable as often as you want. Objects
will still be autoreleased if they were previously autoreleased and
you lose track of them.
Nick Zitzmann
<
http://www.chronosnet.com/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden