Hi all,

I have a 64 bit, Cocoa, GC app.  It loads many large bitmap files.  Each
is about 500 MiB, and the user may want to load about 50 of them.  When
each file is opened, I read the entire file, then downscale the image to
a smaller resolution.  I then no longer need the large image.

Basically my code is like:

- (void)openFiles:(NSArray*)filePaths
{
  for each path in filePaths
    load large image
    downsample
    force collection
}

I call:

objc_collect (OBJC_EXHAUSTIVE_COLLECTION | OBJC_WAIT_UNTIL_DONE);

to force the collection.  I've breaked in finalize, and forcing the
collection does work.

However, Activity Monitor still shows my 'Real Memory' growing very
large.  It doesn't fall back until (I think) the next run through the
run loop.

When physical memory is exhausted, the machine thrashes badly.  If I
change my implementation to load only 1 file, then let the runloop
continue, then load the next file, etc. I never even exhaust my physical
memory.

Why is that?

(Yes, I know it would be better to not block the main thread with such a
long task, but this app is for in-house, so it's ok.)

Thanks,

--
____________________________________________________________
Sean McBride, B. Eng                 [EMAIL PROTECTED]
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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