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. |