Heap dump in visualvm glassfish

1.6k views Asked by At

I have a webservice on amazon ec2 running on glassfish 4 server, I tried to connect visualvm to the server but it were impossible, so I followed this tutorial (http://looksok.wordpress.com/2012/02/10/remote-use-of-visualvm-with-xming/), I installed the plugin glassfish in the server jvisualvm, and now I can monitor glassfish, but i cant do a heap dump to see my application use of memory detailled. How can I do?

Error trying heap dump

1

There are 1 answers

0
Mike On BEST ANSWER

You can use the jmap tool in the JDK to create an HPROF format heapdump: http://docs.oracle.com/javase/6/docs/technotes/tools/share/jmap.html

As an example, with the PID of your GlassFish in the screenshot above, the command would be as follows:

jmap -dump:file=/path/to/my/dumpfile.hprof 1376

You could also use jps to find the process ID:

jps -v

The -v flag makes the output verbose, giving you more information to tell which process is the right one.