Consider a doubly-linked list holding a handful of nodes. If the list
is cleared by nulling the head and tail references, is the GC
intelligent enough to dispose of all of the nodes? For example, the
first node will no longer be referenced by the list, but it will be
referenced by the second node. Likewise, the second node will be
referenced by the first and third nodes, and so on.
Any thoughts?
Andrew Thompson - 01 Nov 2005 18:18 GMT
> Any thoughts?
Yes, that is spelt better. But I doubt it will make
anyone *more* likely to reply. Minor typos. are ignored
by most posters to these groups, most of whom also
prefer to see posts once only.
[ Just a thought for next time. ]
Andy - 01 Nov 2005 18:51 GMT
> Consider a doubly-linked list holding a handful of nodes. If the list
> is cleared by nulling the head and tail references, is the GC
[quoted text clipped - 4 lines]
>
> Any thoughts?
The GC will pick up these 'islands'.
Roedy Green - 02 Nov 2005 01:05 GMT
>Consider a doubly-linked list holding a handful of nodes. If the list
>is cleared by nulling the head and tail references, is the GC
>intelligent enough to dispose of all of the nodes?
Yes. It does not work by reference counting. See
http://mindprod.com/jgloss/gc.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.