harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Lougher" <rob.loug...@gmail.com>
Subject Re: Re: [drlvm] string interning in java
Date Sat, 29 Jul 2006 10:28:00 GMT
On 7/29/06, Nathan Beyer <nbeyer@kc.rr.com> wrote:
>
>
> > -----Original Message-----
> > From: Robert Lougher [mailto:rob.lougher@gmail.com]
> > Sent: Friday, July 28, 2006 7:40 PM
> > To: harmony-dev@incubator.apache.org
> > Subject: Re: Re: [drlvm] string interning in java
> >
> > Hi,
> >
> > On 7/29/06, Alex Blewitt <alex.blewitt@gmail.com> wrote:
> > > On 28/07/06, Salikh Zakirov <Salikh.Zakirov@intel.com> 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!
>
> Can the String from a class constant pool be collected if the class is still
> in use? I'm assuming it can't, so the above is an incomplete response to
> Alex's points, as I imagine it's very possible to have many Strings in
> constant pools that are never or rarely used, but the class objects are used
> quite frequently and would never get collected. For example, the Strings
> used in exceptions that rarely, if every get called in some classes.
>

It wasn't meant to be a complete response.  I was responding to the
following point:

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

Which implies that freeing of the dynamically loaded string when the
class is unloaded is something special.  It is not.  Nor is an
interned string a memory leak.  It will be collected when there are no
more references to it like any other object.

Rob.

> >
> -Nathan
>
> >
> > Rob.
> >
> > >
> > > Alex.
> > >
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message