• 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
Re: Outrunning the Garbage Collector
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Outrunning the Garbage Collector


  • Subject: Re: Outrunning the Garbage Collector
  • From: Marcel Weiher <email@hidden>
  • Date: Fri, 8 May 2009 00:09:17 -0700

Hi Jeffrey,

I have a multithreaded application with several NSOperationQueues and it appears as if under heavy load conditions I'm overwhelming the garbage collector so-to-speak.

From what you describe, it looks like your analysis is spot on.

I essentially have three queues which can be processing different types of operations simultaneously.

- If I load up *one* queue with a bunch of operations and let it run, I find that memory is clean up very nicely. After each operation finishes it gets cleaned up by the collector appropriately.

- If I load up all three queues simultaneously (a not uncommon user scenario for this application), then I find that rarely do any of the operations get cleaned up. Things generally start out alright, but then get jugged up and very quickly the application can run out of memory.

You essentially have to throttle the mutator(s) so they don't outrun the collector. The collector has a tough time keeping up with one full-throttle mutator, three (assuming you've got a thread servicing each queue) is fairly hopeless. Another option *may* be to recode your app to produce significantly less garbage for the collector to clean up.


The GC release notes suggest that it's possible to "outrun" the collector,
http://developer.apple.com/releasenotes/Cocoa/GCReleaseNotes/ index.html

It is, as you've noticed.

Marcel

_______________________________________________

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


References: 
 >Outrunning the Garbage Collector (From: "Jeffrey J. Early" <email@hidden>)

  • Prev by Date: Re: NSXMLParser frees itself on error?
  • Next by Date: Garbage collector related crash
  • Previous by thread: Outrunning the Garbage Collector
  • Next by thread: Garbage collector related crash
  • Index(es):
    • Date
    • Thread