Java heap dump error with jmap command : Premature EOF

前端 未结 1 1051
臣服心动
臣服心动 2020-12-20 13:20

I have encountered below exception during execution of below command

jmap -dump:format=b,file=heap_dump.bin 

output:

相关标签:
1条回答
  • 2020-12-20 13:42

    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)

    jmap -J-d64 -dump:format=b,file=<heap_dump_filename> <pid>
    

    you have to use below option to get the heap dump

    jmap -J-d64 -dump:live,format=b,file=<heap_dump_filename> <PID>
    

    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.

    0 讨论(0)
提交回复
热议问题