• 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: Forcing garbage collection, freeing up memory, thrashing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Forcing garbage collection, freeing up memory, thrashing


  • Subject: Re: Forcing garbage collection, freeing up memory, thrashing
  • From: Bill Bumgarner <email@hidden>
  • Date: Sun, 30 Nov 2008 17:29:19 -0800

On Nov 30, 2008, at 4:44 PM, William Squires wrote:
The collector provides API for this:

	objc_clear_stack(OBJC_CLEAR_RESIDENT_STACK);

NSRunLoop does this automatically as it passes through each loop. Since you are blocking the run loop, you'll have to do this for it.

Wouldn't this make your locals go >poof!<??

It clears from just below the current stack down.

Part of the issue is that the "bottom of the stack" is not necessarily the bottom of the stack. Under certain conditions, there can be quite a number of additional bytes in the "red zone", including references to objects.

The collector has to conservatively scan these bytes to make sure that nothing is pre-reaped, but this can sometimes lead to an object sticking around longer than it should.

objc_clear_stack() clears from the first known to be unused byte of the stack onwards, thus clearing out these phantom references.

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


References: 
 >Forcing garbage collection, freeing up memory, thrashing (From: "Sean McBride" <email@hidden>)
 >Re: Forcing garbage collection, freeing up memory, thrashing (From: Bill Bumgarner <email@hidden>)
 >Re: Forcing garbage collection, freeing up memory, thrashing (From: William Squires <email@hidden>)

  • Prev by Date: Re: about Preferences Toolbar
  • Next by Date: CFMessagePort and GC
  • Previous by thread: Re: Forcing garbage collection, freeing up memory, thrashing
  • Next by thread: Re: Get MD5 without crashing (Mr. Gecko)
  • Index(es):
    • Date
    • Thread