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

Outrunning the Garbage Collector


  • Subject: Outrunning the Garbage Collector
  • From: "Jeffrey J. Early" <email@hidden>
  • Date: Thu, 7 May 2009 21:55:19 -0700

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.

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.

I've tried suspending one of the operation queues for a few seconds and asking the garbage collector to collect, but that didn't work.

I noticed in NSGarbageCollector.h that they say, "collects ..., but subject to interruption on user input". What exactly is "user input"? If I somehow block everything on the main thread for a short time, will this allow the garbage collector to collect?

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


Thanks,
Jeffrey
_______________________________________________

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: Outrunning the Garbage Collector
      • From: Marcel Weiher <email@hidden>
  • Prev by Date: Re: Associating Objective-C objects with Java objects using JNI
  • Next by Date: Re: NSXMLParser frees itself on error?
  • Previous by thread: NSTokenFieldCell in NSTableView
  • Next by thread: Re: Outrunning the Garbage Collector
  • Index(es):
    • Date
    • Thread