Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: garbage collection and NSConnection



On Jul 4, 2008, at 2:25 AM, Joan Lluch (casa) wrote:

First, GC makes programs go slower not because of the overhead of the garbage collection itself, which I concede that may be comparable to the retain/release calls in a non-managed environment, but for the extra memory overhead that it is used. The crucial difference between a non-managed app and a GC app is that in a non- managed app the memory is released very soon after the life of an object has expired.

Please do not spread misinformation about Objective-C garbage collection. What you're essentially asserting is that Objective-C garbage collection will always increase the high-water mark of an application, and that is not the case.


Memory in a GC app is released very soon after the life of an object is over -- sometimes, even sooner than it would be under manual memory management. That's because Objective-C garbage collection runs on a separate thread.

Under non-GC, an object's memory may not be reclaimed until the current autorelease pool is drained. However, under GC, an object's memory can be reclaimed as soon as the collector can tell there are no more references to it -- no matter when that is.

  -- Chris

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: garbage collection and NSConnection (From: "Joan Lluch (casa)" <email@hidden>)
 >Re: garbage collection and NSConnection (From: "Michael Ash" <email@hidden>)
 >Re: garbage collection and NSConnection (From: Joan Lluch (casa) <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.