why perm generation is continuously increasing?

Andreas Loew Andreas.Loew at oracle.com
Fri Feb 17 12:43:24 PST 2012


Hi Li,

citing from here: 
http://kenai.com/projects/btrace/forums/forum/topics/1109-Tracing-simple-program-on-Windows

"BTrace currently does not support tracing native methods. But, it may 
be feasible to support tracing native methods using native method 
prefixing support of java.lang.instrument.
(http://java.sun.com/javase/6/docs/api/java/lang/instrument/Instrumentation.html#isNativeMethodPrefixSupported%28%29)."

I have never tried this myself, but see 
http://docs.oracle.com/javase/6/docs/api/java/lang/instrument/Instrumentation.html#setNativeMethodPrefix%28java.lang.instrument.ClassFileTransformer,%20java.lang.String%29 
on how you should probably be able to work around this by using byte 
code instrumentation and then have BTrace apply your probe into the 
intern() method of your instrumentation wrapper class...

HTH & best regards,

Andreas


Am 17.02.2012 07:52, schrieb Li Li:
> I want to use btrace to locate which function call String.intern()
> but from 
> http://kenai.com/projects/btrace/forums/forum/topics/1109-Tracing-simple-program-on-Windows
> it seems it's not feasible
> any other methods?
> I tried trace method call of String, constructor method and trim 
> method is ok. but native method like intern is not.
>
> On Fri, Feb 17, 2012 at 2:00 PM, Alexey Ragozin 
> <alexey.ragozin at gmail.com <mailto:alexey.ragozin at gmail.com>> wrote:
>
>     Hi,
>
>     FYI
>     Normally permanent generation is collect only during Full GC.
>     -XX:+CMSClassUnloadingEnabled will enable permanent space
>     collection as a part of concurrent old space collection.
>
>     Regards,
>
>         Date: Thu, 16 Feb 2012 20:53:59 +0800
>         From: Li Li <fancyerii at gmail.com <mailto:fancyerii at gmail.com>>
>         Subject: Re: why perm generation is continuously increasing?
>         To: hotspot-gc-use <hotspot-gc-use at openjdk.java.net
>         <mailto:hotspot-gc-use at openjdk.java.net>>
>         Message-ID:
>         <CAFAd71XuyVjQ+=0cTCpCB74wD03VgYe_GhgPj78mcU_pk3syaQ at mail.gmail.com
>         <mailto:0cTCpCB74wD03VgYe_GhgPj78mcU_pk3syaQ at mail.gmail.com>>
>         Content-Type: text/plain; charset="iso-8859-1"
>
>
>         I got it. we use String.intern for temporary variables.
>         I used jmap -permstat and found that.
>         btw jmap -permstat will cause jvm hang and should be carefully
>         used.
>         it hangs for a few minutes!
>
>         On Thu, Feb 16, 2012 at 6:55 PM, Li Li <fancyerii at gmail.com
>         <mailto:fancyerii at gmail.com>> wrote:
>
>         > hi all,
>         >     I found our application's perm generation size is
>         continuously
>         > increasing and will reach 100%(we limit maxPermSize to
>         256MB) and perform a
>         > full gc(which will pause for 10s).after gc, perm size usage
>         falls to  about
>         > 50% and again increasing. what kind of objects will be
>         allocated to perm
>         > generation? we don't use reflection in our application.
>         >
>
-- 
Andreas Loew | Senior Java Architect
ACS Principal Service Delivery Engineer
ORACLE Deutschland B.V. & Co. KG



More information about the hotspot-gc-use mailing list