Skip navigation.
 
mlRe: Garbage collection, core data, and tight loops
FROM : Chris Hanson
DATE : Sun Nov 04 02:59:54 2007

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

Related mailsAuthorDate
mlGarbage collection, core data, and tight loops John R.Timmer Oct 30, 22:03
mlRe: Garbage collection, core data, and tight loops Bill Bumgarner Oct 30, 22:56
mlRe: Garbage collection, core data, and tight loops John R. Timmer Oct 31, 13:37
mlRe: Garbage collection, core data, and tight loops Bill Bumgarner Oct 31, 16:31
mlRe: Garbage collection, core data, and tight loops Ben Trumbull Nov 1, 03:41
mlRe: Garbage collection, core data, and tight loops John R. Timmer Nov 2, 20:01
mlRe: Garbage collection, core data, and tight loops Ben Trumbull Nov 4, 01:26
mlRe: Garbage collection, core data, and tight loops Chris Hanson Nov 4, 02:59
mlRe: Garbage collection, core data, and tight loops John R. Timmer Nov 4, 05:06