Tuesday, October 19, 2010

Jrockit JRCMD

If you are one of those shops where remote access from JRMC (Jrockit Management Console) is not possible, jrcmd comes to rescue.
All we need is access through SSH.
This came in real handy for our environments where remote access is not allowed.

$ ./Jrockit_home/bin/jrcmd PID heap_diagnostics
This would print heap summary, Memory layout (similar to pmap in solaris) and details object statistics

If you are new to Jrockit and familiar with other JVM tools like Jhat or MAT,and would need to do an offline analysis, then a heap dump can be generated in HPROF format.

$ ./Jrockit_home/bin/jrcmd PID hprofdump filename=heapdump.hprof
(heapdump.hprof is created from JVM process spawning directory. For weblogic it will be under domain directory - assuming startscript is triggred from there)
This hprof can be further analyzed with tools like jhat or MAT (Eclipse Memory analyzer tool).
MAT would provide all sorts of info from leak suspects to Accumulated Objects by Class as shown above.




Another neat feature from JRMD is baselining the heap and native memory.
$./Jrockit_home/bin/jrcmd PID print_memusage scale=M baseline
This prints base line of memory usage (both java and native heap) something like:



Subsequent runs of same command would baseline to first snapshot and shows the added java & native heaps.



Reference:
https://www.packtpub.com/oracle-jrockit-the-definitive-guide/book

3 comments:

Web to print solution said...

Hi this news is exactly what I search. I share to your website to my facebook. Thank you update daily this blog will go to peak thanks bye…

Arun said...

Thanks Vijay. It was very useful

Anonymous said...

Thnx it was very useful but can
you further elaborate on these paramters when we do print_memusage :

GC tables - XXX MB
OS - XXX MB
Others - XXXX MB