Search code examples
tomcat7heap-memorycentos7heap-dump

Heap Dump not working Centos 7


I have added following setting in my catalina.sh file -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="/root/logs".

But still the heap dump file is not created when tomcat is going down. I have this setup on centos 7 on AWS.

Please help me in solving this issue... Thanks in advance.


Solution

  • I would suggest try create it manually if it is not generating automatically by using a JDK bundled tool called jmap, although we recommend that you use the automatic method above for best result.

    For Linux/Solaris-based Operating Systems: Please execute the following command on Linux OS:

    $JAVA_HOME/bin/jmap -dump:format=b,file=heap.bin <pid>
    

    More Ref Follow the link below :

    https://confluence.atlassian.com/doc/generating-a-heap-dump-219024032.html