On 5 Oct 2005, at 17:37, [EMAIL PROTECTED] wrote:
I suppose the other potential issue might be the VM holding on to
interned
strings and not releasing them for GC:
So far as I understand, although the Java spec does not mandate
that the
virtual machine garbage collects interned strings, in practise VMs
do this
OK, once there are no reachable references -
so there should be no issue with interned strings hogging memory
unnecessarily.
Certainly this is the case for us using Sun's JDK1.4.2_04
This is the key objection I would have. Certainly earlier Sun JVMs
never released interned strings (I remember having problems with
using interned strings in a Sun JVM a couple of years ago). I
understand that the Sun String pool now use weak references which
allows for garbage collection. However we know that we do have users
who run the code on a wide variety of JVM (including the Microsoft
JVM) and I don't think we can be certain that all our users will be
using a JVM which GCs interned strings.
Fancy implementing a stand alone string pool with weak references?
John Wilson
The Wilson Partnership
http://www.wilson.co.uk