• 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: GC Seems To Never Kick In
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GC Seems To Never Kick In


  • Subject: Re: GC Seems To Never Kick In
  • From: Bill Bumgarner <email@hidden>
  • Date: Thu, 12 Mar 2009 08:43:25 -0700

On Mar 12, 2009, at 8:32 AM, Karl Moskowski wrote:
If I add something like this to the method's processing loop
	if (++block % 1000 == 0)
		objc_collect(OBJC_EXHAUSTIVE_COLLECTION);
memory usage stays reasonable in the Cocoa app.

I've tried other options in various combinations (e.g. objc_collect (OBJC_COLLECT_IF_NEEDED) and objc_clear_stack (OBJC_CLEAR_RESIDENT_STACK)), but only the above seems to help.

Any idea why GC seems to work automatically in a Foundation tool, but in a Cocoa app it sometimes needs manual invocation?

It sounds like the main event loop isn't running and triggering collections properly.


What happens if you kick it off and, say, click semi-spastically on the app's menu bar when it would otherwise die?

If the memory use stays reasonable, that is exactly what is happening.

If not, the workaround above is what would be recommended.

(This is a known issue -- if you search the archive, you'll find others have encountered it.)

Though known, feel free to file a bug. Knowing how many customers encounter a particular issue is very useful.

b.bum

_______________________________________________

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: GC Seems To Never Kick In
      • From: Karl Moskowski <email@hidden>
References: 
 >GC Seems To Never Kick In (From: Karl Moskowski <email@hidden>)

  • Prev by Date: Re: Performance problem with GC enabled
  • Next by Date: Re: GC Seems To Never Kick In
  • Previous by thread: GC Seems To Never Kick In
  • Next by thread: Re: GC Seems To Never Kick In
  • Index(es):
    • Date
    • Thread