Hi,

On 7/29/06, Alex Blewitt <[EMAIL PROTECTED]> wrote:
On 28/07/06, Salikh Zakirov <[EMAIL PROTECTED]> wrote:
> Alex Blewitt wrote:

Importantly, it explains why the Eclipse NLS class uses static string
variables to refer to messages, and not to String literals for exactly
this reason. If you use a static string variable that is dynamically
initialised from a properties file, you only take the memory up when
you need to refer to that message (e.g. in the constructor of an
exception in an exceptional condition). Furthermore, because it's a
dynamically read in string, it doesn't pollute the intern() pool, and
thus when the class is unloaded, the string is unloaded too. Once a
String is intern()'d, it's like a memory leak -- you'll never see that
memory again.

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!

Rob.


Alex.

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



---------------------------------------------------------------------
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