On Jun 24, 2009, at 1:30 PM, Four of Seventeen wrote:
On Jun 24, 12:22 pm, "Stephen C. Gilardi" <squee...@mac.com> wrote:Symbol objects are subject to garbage collection, but the "namespace" and "name" strings that identify them are not. Those strings are "interned" via the "intern" method on java.lang.String. Once a String is interned, there exists a single canonical String object that represents it throughout the remaining lifetime the JVM instance.I'm not sure this is correct. I think recent Sun JVMs can GC unreferenced, interned strings.
Right you are. On reading further, I see that unreferenced interned Strings can be collected in Java 1.2+ because the interning mechanism holds only a weak reference to them.
Thanks for the correction. --Steve
smime.p7s
Description: S/MIME cryptographic signature