RE: An observation about "live" NodeLists

Ray Whitmer wrote,
> I must have missed something here.  Even with unpredictable 
> Java GC, we are still much better off with weak references
> than without.  I would interpret this as greatly helping
> address the problem.

I guess a lot turns on what you count as 'much better off'.
As far as I can see all you gain is not having to implement
the handle-body pattern ... but I think for anyone able to
implement the DOM reasonably well that ought to be a trivial
exercise.

As it happens, handle-body+finalize is the guts of the
underlying implementation of weak refs in 1.2 as a peek
at the JDK sources will reveal.

The issue about GC unpredicatability is a real one. Suppose
we're doing stuff on the server-side and have a long lived
DOM, which is manipulated via NodeLists many times over an
extended period. Un-GCed NodeLists will accumulate over
time; as they do performance will tail off until they're
reclaimed and finalized (with handle-body), or weak refs do
their thing (in Java 1.2).

OK, that's speculation ... I'd be interested to see some
stats and analysis from someone (Ray?) who's put that sort
of implementation together.

Cheers,


Miles

-- 
Miles Sabin                          Cromwell Media
Internet Systems Architect           5/6 Glenthorne Mews
+44 (0)181 410 2230                  London, W6 0LJ
msabin@cromwellmedia.co.uk           England

Received on Tuesday, 20 October 1998 13:26:16 UTC