On 29/07/06, Robert Lougher <[EMAIL PROTECTED]> wrote:
The interned String table should be garbage-collected.  If the only
reference to an interned String is from the class constant pool it
will be collected when the class is unloaded.  If the intern table is
preventing Strings from being collected it's a bug in the VM!

Garbage collection only occurs when there's no references left. String
literals in classes are stored in the constant pool; the constant pool
thus points to the (auto-intern()'d) Strings. So constant string
literals can never be garbage collected, regardless of whether an
intern()'d table is GC'd or not.

Ergo, any code of the form Message.get("some text") has just wasted
"somem text".length() chars in the intern() table permanently, until
that class gets unloaded, *regardless of whether that message is ever
used*

Alex.

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to