Re:Mac Apps That Use Garbage Collection Must Move to ARC
by bitwize on Saturday February 21, 2015 @11:06AM
(#9085827)
Everything GC can do, ARC can do in strict space and time constraints.
[ Parent
| on HN ]
Re:Mac Apps That Use Garbage Collection Must Move to ARC
by danbruc on Saturday February 21, 2015 @11:36AM
(#9085936)
Plain (automatic) reference counting can not handle cycles without support from developers.
Re:Mac Apps That Use Garbage Collection Must Move to ARC
by blub on Saturday February 21, 2015 @04:04PM
(#9086932)
I find that a good thing, because developers are trained to think that they have to use weak references and think about object lifetimes.
Android developers tend to not think so much about lifetimes which leads to memory leaks because Dalvik apparently can't figure out some of those cycles by itself. Just do a search for "Android memory leak" to see some examples.
Re:Mac Apps That Use Garbage Collection Must Move to ARC
by tomjen3 on Sunday February 22, 2015 @07:58AM
(#9089223)
Try to parse any tree structure without creating cycles (say the XML/XHTML inside an ebook) - that may be possibly with just one or two devs on the project but as soon as every dev doesn't know every line of code there is an oppertunity for errors and you only need one link to leak memory.
That Dalvik can't handle the cycles is stupid but an issue with Dalvik (that is likely to be phased out with the new runtime) not an issue with GC. Computers are really, really, good about executing trivial tasks repeatedly without ever making a stupid mistake, humans not so.
And as Terminator taught us: never send a human to do a machines job.
Re:Mac Apps That Use Garbage Collection Must Move to ARC
by smrtinsert on Saturday February 21, 2015 @07:13PM
(#9087587)
A platform with 80% of mobile installations has developers who don't understand object lifecycles
Got it.
Re:Mac Apps That Use Garbage Collection Must Move to ARC
by kasabali on Saturday February 21, 2015 @07:40PM
(#9087656)
I guess he meant Android application developers, not the people who wrote Dalvik.
Re:Mac Apps That Use Garbage Collection Must Move to ARC
by danbruc on Saturday February 21, 2015 @01:15PM
(#9086286)
And time constraints are also more of an illusion than real - unless your program has no input from the outside world you can not really know when a reference count will drop to zero and triggers a deallocation. Every time a reference goes away may be the time an (unexpected) deallocation happens.
Re:Mac Apps That Use Garbage Collection Must Move to ARC
by chrisseaton on Saturday February 21, 2015 @07:56PM
(#9087704)
Can ARC move objects to compact the heap?