Capture heap dump using jmap:
Use the following command to generate a heap dump when the server is at a critical memory level (reaching the limit for an out of memory). This should typically generate a very large file called heap.bin.
Syntax: /Java/jdk/bin/jmap -heap:format=b <pid>
Eg: jmap -heap:format=b 19096
<pid> is the process number of the WebLogic server instance
Capture heap dump when OOM occurs:
Enable flag "-XX:+HeapDumpOnOutOfMemoryError" in server startup script which will generate heapdump when OOM happens.
Eg: JAVA_OPTIONS="-verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -Xloggc:/local/apps/oracle/middleware/user_domains/test/bin/gc.txt -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/local/apps/oracle/middleware/user_domains/test/bin " ${JAVA_OPTIONS}"
Review the heap dump to under the objects that are occupying the memory and the frequency that they get generated until they actually reach JVM memory threshold.
Nice and good blog.I have suggested to my friends to go through this blog. Thanks for sharing this useful information. If you want to learn Linux course in online, please visit below site.
ReplyDeleteLinux Online Training
linux online course
Linux Online Training in Hyderabad
Linux Online Training in Bangalore
Linux Online Training in Chennai