Java heap dump error with jmap command : Premature EOF

I have encountered below exception during execution of below command


JDK version : 1.7.0_45


Hardware : RHEL 5.x, 4 core CPU Linux machine 6 GB RAM

As per oracle bug report database (, this issue has been fixed state but I am still getting jdk 1.7 version with build no:45

Can you suggest any solution other than upgrading to Jdk 1.8, which is not possible in my case due to other dependencies?


I have tried with below command and this command too does not work (generated partial dump file) and shows same Premature EOF.

I have triggered the command with the user, who started the process. That user had write permissions to the directory. The file was generated but it was incomplete.

9 MB file was written for 2 GB heap, which is not usable for analysis.


Brian's comment is helpful to resolve the issue.

If you are using G1GC algorithm in 64 bit machine:

Below command does not work ( excluding live option)

you have to use below option to get the heap dump

There are some suggestions to use -F option to force heap dump but as per oracle technotes:

-F Force. Use with jmap -dump or jmap -histo option if the pid does not respond. The live suboption is not supported in this mode.

Since heap dump is required with G1GC option, above option can't be used.