Garbage Collection makes my app look fat
Garbage Collection makes my app look fat
- Subject: Garbage Collection makes my app look fat
- From: August Trometer <email@hidden>
- Date: Mon, 25 Feb 2008 01:00:02 -0500
I've got a small app that, once per minute, redraws a view. In this
case, it's a large view.
In that view's drawRect: method, I composite several images to get the
final product.
I began to notice, using Activity Monitor, that the app was taking a
tremendous amount of memory. On further investigation, the memory
started at a reasonable 14MB, then increased with every redraw. After
several minutes, I was looking at half a gig of memory used.
My drawing is highly optimized for memory use (no caching, etc.), yet
I can't understand why the memory skyrocketed with every draw. I
turned all that off, yet still had the same problem. I tried using
Shark and Instruments, Omni Object Meter, anything I could to figure
out what was going on, and there seemed to be no real culprit.
Then I turned off Garbage Collection, and memory usage plummeted to
the level I was expecting.
I'm still getting my feet wet with Garbage Collection, and I don't
entirely trust it. Is there something I've missed in the docs to
explain this behavior? I'm guessing that, at some point, the extra
memory will be reclaimed, but for a user, seeing 500MB of real memory
usage would be, well, off-putting, especially for a rather small app.
I'd very much like to use GC, but unless I can keep that number down,
I simply can't. Any suggestions?
Thanks!
August
_______________________________________________
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