On Jul 5, 2008, at 3:00 PM, Joan Lluch (casa) wrote:

However, let me copy an excerpt of the Cocoa documentation on the GC algorithm that Cocoa uses.

You haven't updated your documentation since the beginning of November last year.


<begin excerpt>
[...]
The collector runs exclusively on the main thread of the application. At no time are all threads stopped for a collection cycle, and each thread is stopped for as short a time as is possible. Threads may be blocked for a short time while all unreachable objects are formed into the garbage list and weak references zeroed. Only threads that have directly or indirectly performed an[NSThread self] operation are subject to garbage collection.

This is not correct for the current implementation of the collector:

The collector is both request and demand driven. The Cocoa implementation makes requests at appropriate times. You can also programmatically request consideration of a garbage collection cycle, and if a memory threshold has been exceeded a collection is run automatically.

The collector runs on its own thread in the application. At no time are all threads stopped for a collection cycle, and each thread is stopped for as short a time as is possible. It is possible for threads requesting collector actions to block during a critical section on the collector thread's part. Only threads that have directly or indirectly performed an [NSThread self] operation are subject to garbage collection.

The collector is generational (see “Write Barriers”)—most collections are very fast and recover significant amounts of recently-allocated memory, but not all possible memory. Full collections are also fast and do collect all possible memory, but are run less frequently, at times unlikely to impact user event processing, and may be aborted in the presence of new user events.

<http://developer.apple.com/documentation/Cocoa/Conceptual/GarbageCollection/Articles/gcArchitecture.html >

mmalc

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to