review for 7108242: jinfo -permstat shouldn't report interned strings as part of perm

Krystal Mok rednaxelafx at gmail.com
Fri Nov 4 00:37:23 PDT 2011


Hi David,

FYI:

I'm not sure what's the best way to expose the stats of interned strings,
but from an implementation perspective, the size of interned strings can
easily be determined by scanning the StringTable in HotSpot. It can be done
from both inside the HotSpot VM itself; or from the Serviceability Agent
(via sun.jvm.hotspot.memory.StringTable).

The StringTable data structure keeps **references** (*oop*s) to the
interned *String* objects, instead the *String*s themselves. It doesn't
really matter whether or not the Strings are in PermGen or not. The table
itself was never stored in the GC heap; instead it's a part of the GC root
set.

Regards,
Kris Mok

On Fri, Nov 4, 2011 at 9:09 AM, David Schlosnagle <schlosna at gmail.com>wrote:

> > Tom Rodriguez wrote:
> > jinfo -permstat still reports interned strings as part of the perm gen
> > which is no longer true.  It should be dropped.
>
> Out of curiosity, is there any way to determine the size of the
> interned strings now that they are no longer in PermGen? I assume that
> since 6962931 [1] with interned strings moving to the regular heap
> there isn't any way to compute the size of interned strings other than
> through a heap dump where they would show up like any other String,
> but I'd just like to confirm.
>
> Thanks,
> Dave
>
> [1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6962931
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20111104/39bea86e/attachment.html 


More information about the hotspot-compiler-dev mailing list