2012/4/27 Christopher Schultz <ch...@christopherschultz.net>:
> All,
>
> I've been doing some memory profiling on my webapp to see where I can
> reduce our memory footprint a bit by combining equivalent objects.
> YourKit has some nice utilities to look for duplicate objects --
> especially Strings.
>
> I can see that the string "java.lang.String" has lots of duplicates.
> Many of the ones I've inspected so far can be traced-back to
> catalina.mbeans.MBeanUtils and the registry of MBeans that it contains.
>
> Would anyone object to using String-interning to share copies of class
> names for MBeans? I could even restrict such interning to Strings that
> start with "java.lang" since those are probably the most-used ones, and
> those strings are probably already interned by all the RTTI
> infrastructure in the JVM anyway.

I think that the string returned by class.getName() as well as field
and method names should be already interned by JVM.

So instead of String.intern() it should be possible to call class.getName(). :/

I am OK with your proposal, but I do not expect much savings from
getting rid of those duplicates.   Does YouKit show some estimates?

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to