• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Garbage Collection makes my app look fat
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Garbage Collection makes my app look fat
      • From: Keith Duncan <email@hidden>
    • Re: Garbage Collection makes my app look fat
      • From: j o a r <email@hidden>
    • Re: Garbage Collection makes my app look fat
      • From: "Hamish Allan" <email@hidden>
  • Prev by Date: Re: Observing with GC
  • Next by Date: Re: Catching Cocoa application Crash
  • Previous by thread: Example: Drag and Drop with Core Data Relationships
  • Next by thread: Re: Garbage Collection makes my app look fat
  • Index(es):
    • Date
    • Thread