Re: Garbage collection, core data, and tight loops
Re: Garbage collection, core data, and tight loops
- Subject: Re: Garbage collection, core data, and tight loops
- From: Chris Hanson <email@hidden>
- Date: Sat, 3 Nov 2007 18:59:54 -0700
On Nov 2, 2007, at 12:01 PM, John R. Timmer wrote:
Using an autorelease pool for each batch worked well, keeping memory
use extremely low.
One other tip: Switch from using [pool release] to using [pool drain]
for your NSAutoreleasePool instances, and see how that affects the
version of your application running under garbage collection. It will
look "wrong" at first (since you'll no longer be balancing the
[[NSAutoreleasePool alloc] init] with a -release) but the -drain
message will *not* be consumed by the runtime under GC as -release
will. Instead, it actually provides a hint to the collector that you
it may be a good time to pick up some newly-generated garbage.
-- Chris
_______________________________________________
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