• 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: garbage collection and NSConnection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: garbage collection and NSConnection


  • Subject: Re: garbage collection and NSConnection
  • From: Chris Hanson <email@hidden>
  • Date: Fri, 04 Jul 2008 13:54:01 -0700

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: garbage collection and NSConnection
      • From: "Hamish Allan" <email@hidden>
    • Re: garbage collection and NSConnection
      • From: "Joan Lluch (casa)" <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>)

  • Prev by Date: Re: c++ exceptions in objective c call stack
  • Next by Date: Re: c++ exceptions in objective c call stack
  • Previous by thread: Re: garbage collection and NSConnection
  • Next by thread: Re: garbage collection and NSConnection
  • Index(es):
    • Date
    • Thread