5 ms·
I can't help but think that ARC has pretty much killed garbage collection. Why use garbage collection at all when you have a static equivalent that works just a
by nikster 14y ago
I can't help but think that ARC has pretty much killed garbage collection. Why use garbage collection at all when you have a static equivalent that works just as well?
- mikeash 14y agoIt doesn't work nearly as well. ARC doesn't handle cycles at all, which makes it substantially more painful to use than a garbage collector. Don't get me wrong. ARC is great compared to the previous situation, but it's simply not a substitute for a real GC. Automatic reference counting dates back to probably the 1950s. If it "works just as well" as garbage collection, don't you think it would have won by now?
- seanmcdirmid 14y agoOne day a student came to Moon and said, "I understand how to make a better garbage collector. We must keep a reference count of the pointers to each cons." Moon patiently told the student the following story - "One day a student came to Moon and said, "I understand how to make a better garbage collector... http://www.csd.uwo.ca/staff/magi/personal/humour/Computer_Folklore/The%20Garbage%20Collection%20Koan.html http://www.csd.uwo.ca/staff/magi/personal/humour/Computer_Fo...
- mikeash 14y agoThis makes me paranoid that you can read my thoughts.
- seanmcdirmid 14y agoWhy? The garbage collection koan is common knowledge among compiler and PL people, I just took some initiative.
- mikeash 14y agoIt's a joking way to indicate that this is exactly what I was thinking of when I wrote my comment.
- rayiner 14y agoARC doesn't work just as well. At least theoretically, ARC retains a lot more garbage because the compiler has to be much more conservative about reachability than the garbage collector. ARC has theoretical failure modes that can cause huge amounts of retained garbage, and that's less well-understood than the failure modes of GC. Doing reference count updates is also generally slower in terms of CPU cycles than doing garbage collections. Oh, and ARC doesn't handle cycles. That said, I think reference counting warrants more attention than it has gotten in memory management research. If you're willing to punt on the leaking cycles issue, you can get a lot of mileage out of using a reference counting collector as a tenured generation with a copying nursery.
- stcredzero 14y ago> you can get a lot of mileage out of using a reference counting collector as a tenured generation with a copying nursery. Are there implementations one can play with?
- rayiner 14y agoI think MMtk might have an implementation of the technique. There are some papers on it: http://www.cs.technion.ac.il/~erez/Papers/AzatchiPetrankCCPE.pdf http://www.cs.technion.ac.il/~erez/Papers/AzatchiPetrankCCPE...
- ynniv 14y agoBesides memory fragmentation?
- aaronbrethorst 14y agoARC has absolutely killed garbage collection. Important: Garbage collection is deprecated in OS X v10.8. You should use ARC instead—see Transitioning to ARC Release Notes. https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSGarbageCollector_class/Introduction/Introduction.html https://developer.apple.com/library/mac/#documentation/Cocoa... Whether ARC is better or worse than GC overall is immaterial. Apple has moved away from garbage collected Objective C.
- jonknee 14y ago> ARC has absolutely killed garbage collection ... In Apple's Sandbox. Apple has also killed ethernet and other very not-dead in the real world things.
- i386 14y agoKilled ethernet? Thats a somewhat ill-informed statement to make. The latest iMac still has an ethernet port. They did remove it from their line of portables as most people use wireless with their laptops (and they scored some valuable real-estate on the main board!) but you can get a Thunderbolt network card if you really want to be tethered to your desk.
- jonknee 14y agoAh, the iMac that you still can't buy (end of the year is a really strange time to have no inventory of your new flagship desktop)... But that's another rant. Apple's computers (desktops included, save for the Mac Pro which is essentially EOL) no longer have an optical drive, maybe I should have used that instead. I saw a coworker hunting for his MacBook's ethernet port today, so it was was fresh in my mind.
- jcromartie 14y agoI honestly can't remember the last time I used an optical drive (and I have one in my MBP). Alternatives are superior in virtually every way.
- deleted 14y ago[deleted]
- krichman 14y agoARC is terrible, I've had far more errors with it than I ever did without.
- Apocryphon 14y agoDo tell, please.
- darknoon 14y agordar? I'm calling BS on this.
- jcromartie 14y agoCurious... I've never had a problem with it.
- deleted 14y ago[deleted]