jmap notes

If you search for how to get a memory dump for a java process many will recommend jmap.

On a server, jmap is the tool to use since jvisualvm requires some ui and that is rarely available in our setup.

The command to use is simple:

jmap -heap.format:b <pid>

The problem is that it “freezes” your java application as the heap is being dumped and when you have a process that uses a bit of memory it takes a long time (very long time). The app I tried to get information from was using 2.3 Gb and after 30 minutes it was not done writing to the heap.bin. Had to abandon.

Advertisements

Published by

m5c

Java developper that loves photography and good coffee

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s