LWN.net Logo

Refcounting is fine...

Refcounting is fine...

Posted Aug 21, 2011 8:39 UTC (Sun) by khim (subscriber, #9252)
In reply to: Java is new Tk by tzafrir
Parent article: HP dropping webOS devices

With refcounting you still must think about objects lifetime. Thus you still will create sane designs because you must make sure you'll not create loops. But full GC encourages "don't know and don't care when this object will be removed" designs - and these can only be fixed with full rewrite.


(Log in to post comments)

Refcounting is fine...

Posted Aug 31, 2011 14:25 UTC (Wed) by nix (subscriber, #2304) [Link]

Er, recursive reference loops are common in all sorts of designs. In pure refcounted ones, you have to use crocks like having a single object registry and having everything else have references to it, even if that is otherwise unnatural. A good few refcounted implementations (including Python and IIRC Ruby too) collect cyclic garbage just fine, by having a conventional GC as well (in Python's case, a generational GC with a variety of optimizations to take into account that most garbage is already collected by the refcounter, so most of what it will see is uncollectable).

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds