How to Generate Heap Dump in Weblogic Explain the Command?

Answer: Here are the most common ways to do it. You will use these if you have Out Of MemoryException (OOM) and you would like to take a look at the issue to determine the root cause.

1. For Hotspot/Oracle JDK, you need to add the following parameters to JAVA_OPTIONS

-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=path

2. Similarly for JRockit, you need to the JAVA_OPTIONS below:

-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=C:myApphprof-dumps

But, let’s say that you are experiencing OOM, but you still don’t determine the root cause of the issue.
You might probably need to restart as soon as you see performance issues or even better daily.
Then, #1 and #2 won’t help.

You can use a tool like the ones below:

3. Jump, e.g.:

JAVA_HOME/bin/jmap -dump:format=b,file=c:tempheap.prof PID

4. Or if you have already a core file and you would like to have a heap dump as well, you can also get a heap dump: (E learning)

jmap -dump:format=b,file=heap.prof $JAVA_HOME/bin/java /home/limestone/core.27436

5. Or even jrcmd for JRockit:
%JROCKIT_HOME%binjrcmd PID of target JVM hprofdump filename=full pathname to the target dump file name.

Note: Browse latest  Weblogic interview questions and  Weblogic tutorial. Here you can check  Weblogic Training details and  Weblogic training videos for self learning. Contact +91 988 502 2027 for more information.

Leave a Comment

FLAT 30% OFF

Coupon Code - GET30
SHOP NOW
* Terms & Conditions Apply
close-link