jvisualvm: Stuck on “Loading Heap Dump” screen

≡放荡痞女 提交于 2020-01-29 21:24:25

问题


I created a heap dump file with hprof using this command:

java -agentlib:hprof -cp "..\..\jars\trove.jar;.\bin" com.mysite.MyApp

This successfully created the file "java.hprof.txt" which was about 5MB. I then opened up jvisualvm to view this file, and loaded it in. But visualvm appears to be stuck on the loading screen. The screen below has been up for about 10 minutes now.

Did I miss a step? Should I have used different options on the command line with hprof? How can I read this heap dump file?


回答1:


VisualVM supports heap dumps in binary HPROF format. It is easier to use VisualVM to create heap dump. If this is not possible use VisualVM, you can use jmap -dump:live,format=b,file=heap.bin <pid>. The advantage is that you don't need any special startup arguments and there is no slow down caused by hprof agent library.




回答2:


In my case, I have resolved this issue by changing file permission of heapdump file. It turned out VisualVM tried to load the file but permission is denied (which is strange since VisualVM is the one created the dump file), however VisualVM does NOT give you error message. I have downloaded the eclipse memory analyzer (https://www.eclipse.org/mat/downloads.php). It gives me an error message.



来源:https://stackoverflow.com/questions/16461494/jvisualvm-stuck-on-loading-heap-dump-screen

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