Friday, June 27, 2014

Using jmap utility to take heap dump on an application running in VPC

If you have secure environments in which there are strict ingress/egress rules and cannot open up jmx ports for tools like VisualVM or set JVM parameters like -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/heapdump

In such cases you can use jmap utility such as

$ jmap -dump:format=b,file=/tmp/heapdump <pid>
Dumping heap to /tmp/heapdump ...
Heap dump file created

Once the dump has been generated, you can analyze the heap using Eclipse memory analyzer (MAT)

No comments:

Post a Comment