Search code examples
javaheap-memoryweblogic11gheap-dump

How to take memory snapshots at regular interval for jrockit?


We are running some heavy deployments on weblogic setup and it takes around an hour. During that time, we want to take a memory snapshots/heap dumps to see how much headroom we have wrt memory to avoid crash. Is there any optional jvm arg that we can provide while starting the server which will do the job? I checked below link but nothing is fitting the requirement - http://docs.oracle.com/cd/E15289_01/doc.40/e15062/optionxx.htm


Solution

  • If acceptable to drive the snapshots from the outside then you can use jrcmd to send commands to your JVM.

    To get the PID use

    jrcmd -P
    

    and then you can use

    jrcmd PID hprofdump dumpfile.bin
    

    See http://docs.oracle.com/cd/E15289_01/doc.40/e15062/diagnostic.htm#BABIACCC for hrpofdump and http://docs.oracle.com/cd/E15289_01/doc.40/e15061/ctrlbreakhndlr.htm#i1001760 for jrcmd.