I\'ve tried this Get a heapdump on JVM from Tomcat 6 but it doesn\'t work for me, Is there other ways to get heap dump from tomcat server? Thanks in advance!
Another way besides the "Dump heap"-Button of jvisualvm is via the JMX-interface. This way even allows you to specify where to store the dump.
connect to tomcat's JMX-server using jconsole or jvisualvm with JMX-plugin. Then got to com.sun.management
-> HotSpotDiagnotic
-> Operations
. Next to dumpHeap
fill in the two parameters. From oracle's documentation (see here):
Parameters:
outputFile - the system-dependent filename
live - if true dump only live objects i.e. objects that are reachable from others
Then press dumpHeap
and watch the VM freeze for some time while writing the dump.