jvm - jmap -permstat takes long time and hangs -
we started seeing 'java.lang.outofmemoryerror: permgen space'. in order findout held in perm space, tried running
'/usr/j2sdk1.6.0_13/bin/jmap -permstat 20476 -j-mx1280m > /tmp/permstats20476.txt &'
this command taking long time ..... in between gave below exception:
finding class loader instances ..252829 intern strings occupying 30781792 bytes. finding object size using printezis bits , skipping over... finding object size using printezis bits , skipping over... finding object size using printezis bits , skipping over... finding object size using printezis bits , skipping over...
done. computing per loader stat ..done. please wait.. computing liveness...................exception in thread "thread-1" java.lang.outofmemoryerror: gc overhead limit exceeded @ sun.jvm.hotspot.debugger.linux.linuxdebuggerlocal.readbytesfromprocess0(native method) @ sun.jvm.hotspot.debugger.linux.linuxdebuggerlocal.access$1000(linuxdebuggerlocal.java:51) @ sun.jvm.hotspot.debugger.linux.linuxdebuggerlocal$1readbytesfromprocesstask.doit(linuxdebuggerlocal.java:558) @ sun.jvm.hotspot.debugger.linux.linuxdebuggerlocal$linuxdebuggerlocalworkerthread.run(linuxdebuggerlocal.java:127)
but not completing ...
[svcmig2@app430 ~]$ uname -a linux app430... 2.6.18-194.el5 #1 smp tue mar 16 21:52:39 edt 2010 x86_64 x86_64 x86_64 gnu/linux
is there other alternates jmap ? perm stats fast
is there other alternates jmap ? perm stats fast
you can make 1 yourself! easy aid of serviceability agent.
here example case:
import sun.jvm.hotspot.memory.*; import sun.jvm.hotspot.oops.*; import sun.jvm.hotspot.runtime.*; import sun.jvm.hotspot.tools.tool; public class permtool extends tool { @override public void run() { // show permgen object histogram objecthistogram histo = new objecthistogram(); vm.getvm().getobjectheap().iterateperm(histo); histo.print(); // list classes in permgen classloaders vm.getvm().getobjectheap().iterateperm(new defaultheapvisitor() { @override public boolean doobj(oop obj) { if (obj instanceof instanceklass) { obj.printvalue(); oop loader = ((instanceklass) obj).getclassloader(); if (loader == null) { system.out.println(" -- loaded bootstrap classloader"); } else { system.out.print(" -- loaded "); loader.printvalue(); system.out.println(); } } return false; } }); } public static void main(string[] args) { new permtool().start(args); } }
just compile , run using same jdk target process.
make sure jdk/lib/sa-jdi.jar
on classpath.
Comments
Post a Comment