Re: Autorelease pools?
Re: Autorelease pools?
- Subject: Re: Autorelease pools?
- From: Greg Hulands <email@hidden>
- Date: Fri, 19 Mar 2004 13:48:45 +1000
Since we are on this topic I would just like to ask a question that
popped into my mind when I was creating a image indexing application.
Basically it opened any file you gave it and created a thumbnail on a
index (like what you get when you drop your photos off to get printed).
It used a tight loop with an autorelease pool, but so I wasn't
destroying the autorelease pool and recreating it every cycle of the
loop, I decided to do it every 5 cycles through. Because I was working
with images, I didn't really want to do it every n cycles through the
loop but rather if the autorelease pool was n MB in size to destroy and
recreate it. The reason for this is that sometimes I index quite a few
200MB images and when it only releases every 5 times, that can be 1GB
of memory or a lot of paging to disk for those with less that 1GB.
It never really worried me so I never filed an enhancement request, but
it was just something I thought would be useful to the autorelease
pool- to query its size.
Greg
On 19/03/2004, at 1:03 PM, Gregory Weston wrote:
On Mar 18, 2004, at 9:15 PM, Kevin Ballard wrote:
Can anybody tell me what's the point of creating your own autorelease
pools when Cocoa automatically creates one for you?
In addition to the situations John S mentioned, you may just want
finer control over the destruction of objects. Say you've got a loop
that creates a large number of transient objects on each pass (and
isn't especially time critical). Perfect place to put in a new pool.
G
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.