• 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: Why ARC over garbage collection?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why ARC over garbage collection?


  • Subject: Re: Why ARC over garbage collection?
  • From: Quincey Morris <email@hidden>
  • Date: Mon, 15 Oct 2012 18:07:12 -0700

On Oct 15, 2012, at 17:37 , Rick Mann <email@hidden> wrote:

So, was Apple's Obj-C GC not very good? Certainly seems to work fine on my OS X apps.

No, it was pretty good. I suspect the ultimate problem was that no progress seems to have made in porting it to iOS, which meant that two memory models had to be maintained.

With GC, although performance (in the CPU usage sense) *could* sometimes be an issue, the real drawbacks were:

-- The high memory tide marks between collections. Some operations could allocate millions of objects before collection occurred. As Jens says, there are more sophisticated GC techniques that will avoid such drawbacks, but I suspect Apple was having trouble tuning them for general application use and/or iOS use.

-- There were difficult issues with object finalization (i.e. destruction) in the Mac OS GC architecture. It was really hard to get right.

OTOH, no one's actually mentioned the big draw-back with ARC (and the older manual memory management) -- retain cycles. This was a huge win in GC. In *some* non-GC cases, if you keep your ownership declarations straight, retain cycles are fairly easy to avoid, but in many cases designing around retain cycle problems can add considerable complexity.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Why ARC over garbage collection?
      • From: Crispin Bennett <email@hidden>
References: 
 >Why ARC over garbage collection? (From: Rick Mann <email@hidden>)
 >Re: Why ARC over garbage collection? (From: Fritz Anderson <email@hidden>)
 >Re: Why ARC over garbage collection? (From: Jens Alfke <email@hidden>)
 >Re: Why ARC over garbage collection? (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: Why ARC over garbage collection?
  • Next by Date: Re: Why ARC over garbage collection?
  • Previous by thread: Re: Why ARC over garbage collection?
  • Next by thread: Re: Why ARC over garbage collection?
  • Index(es):
    • Date
    • Thread