Re: Hello and NodeIterator Revisited

Vidur,

>My impression is that you could use weak references in Java (see
>java.lang.ref.WeakReference) to deal with your accumulation problem. Your
Node
>implementation could hold on to its NodeIterators using weak references.
The
>NodeIterators would be GC'd when the last "external" reference was dropped.

Well, it turns out that weak references are not needed.  The real problem I
see at this point is that NodeIterators are used too often without any
facility for recycling.  One NodeIterator is instantiated for each Element
with children and another is needed to iterate attributes.  This is
sufferable if each elements are relatively heavy but if elements are being
used like the way HTML is being used, you can expect quite a trashing from
GC.

Don Park
http://www.docuverse.com/personal/index.html

Received on Wednesday, 6 May 1998 12:54:46 UTC