• 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: Fritz Anderson <email@hidden>
  • Date: Mon, 15 Oct 2012 18:02:19 -0500

On 15 Oct 2012, at 5:38 PM, Rick Mann <email@hidden> wrote:

> So, why is it that Apple considers ARC a better solution that garbage collection? Is it a performance thing?

Garbage collection requires a continuously-running thread. This makes it impossible to throttle power usage and potentially steals cycles from the UI thread. The generational collector is virtually guaranteed to catch orphaned objects _eventually_, but the orphans can take up an arbitrarily large amount of memory waiting for "eventually" to arrive.

None of this is acceptable on devices that have limited battery life, comparatively little RAM, no paging, and CPUs that are orders of magnitude slower than those in desktop machines. And no developer is cheerful about Yet Another Damn Thread.

With ARC, you still have to understand reference-counted memory management, and you still have to debug corner cases. But the corner cases are no easier under garbage collection. You can still end up exhausting memory with transient objects; unlike with garbage collection, there is a reliable way to reproduce and debug such problems.

GC is intolerable on iOS. Whether it's tolerable on the Mac is a matter of opinion, but it's not obvious that GC wins. Apple can't afford to have two automatic memory-management schemes, so GC loses.

	— F


 _______________________________________________
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: Jens Alfke <email@hidden>
References: 
 >Why ARC over garbage collection? (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: Why ARC over garbage collection?
  • Next by Date: Build failure dependent on target device/simulator
  • Previous by thread: Re: Why ARC over garbage collection?
  • Next by thread: Re: Why ARC over garbage collection?
  • Index(es):
    • Date
    • Thread