java 1.7.45 : How to get full heap dump of process instead of truncated dump

ε祈祈猫儿з 提交于 2019-12-12 01:25:47

问题


I am using below command to get heap dump

jmap -dump:live,format=b,file=/tmp/heap2.bin <pid>

VM opts:

-Xms2g -Xmx4g  -XX:+UseG1GC -XX:MaxGCPauseMillis=1500 
-XX:G1HeapRegionSize=2 -XX:+PrintFlagsFinal -XX:ParallelGCThreads=4 -XX:ConcGCThreads=2 

But this command generates 300+ MB bin heap dump file for process running with 1.2 GB memory( 1.2 GB memory has been shown in RES column of top command)

EDIT: I have removed :live option after @kdgregory suggestion but heap dump is not generated due to G1GC issue ( Related SE question: Java heap dump error with jmap command : Premature EOF)

My queries:

  1. How to get complete heap dump of process with other GC algorithms like CMS ?

  2. How to get heap dump along with PermGen memory too? (permstat from command line is not useful for me).I am interested in analysis of PermGen OutOfMemory error too.

来源:https://stackoverflow.com/questions/34072070/java-1-7-45-how-to-get-full-heap-dump-of-process-instead-of-truncated-dump

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!