简体   繁体   中英

Tomcat heap dump creation

In our Environment the tomcat server got hanged frequently then we increase the heap and restart the tomcat.

There is any another way to analyze the heap dumps in tomcat?? can we create the heap dumps in tomcat? if possible how?

Thanks Surya

First, you should analyze exactly what causes your Tomcat to hang. There are many reasons which can cause an application to "hang", eg dead locks, long GC pauses, etc.

Looking at the heap dump makes sense if your Tomcat crashes with an OutOfMemoryError . In that case you can use a tool like MAT to analyze the heap dump.

You can create heap dumps any time with jcmd <pid> GC.heap_dump <file> . You can also set the VM option -XX:+HeapDumpOnOutOfMemoryError . This will dump the heap automatically when you get an OutOfMemoryError .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM