简体   繁体   English

jvisualvm:卡在“正在加载堆转储...”屏幕上

[英]jvisualvm: Stuck on “Loading Heap Dump…” screen

I am using jdk64 and my java version is "1.6.0_24".我使用的是 jdk64,我的 java 版本是“1.6.0_24”。 My tomcat is running with -Xmx7196m, and jvisualvm is running with -J-Xms2048m -J-Xmx3072m.我的 tomcat 使用 -Xmx7196m 运行,而 jvisualvm 使用 -J-Xms2048m -J-Xmx3072m 运行。 I took a heap dump of my tomcat java process and size of my .hprof file is around 5.5 GB.我对我的 tomcat java 进程进行了堆转储,我的.hprof文件的大小约为 5.5 GB。 When I try to open this heap dump, it just stuck on Loading Heap Dump... screen.当我尝试打开这个堆转储时,它只是停留在Loading Heap Dump...屏幕上。

I also looked at the heap consumption of VisualVM while it is trying to open the heap dump, but that goes around 500MB only.我还查看了 VisualVM 在尝试打开堆转储时的堆消耗情况,但只有 500MB 左右。

NOTE: I did look at jvisualvm: Stuck on “Loading Heap Dump” screen question but it is different and does not address my question.注意:我确实看过jvisualvm: Stuck on “Loading Heap Dump” screen question,但它是不同的,并没有解决我的问题。

These symptoms also occured when I tried to load a large heap dump and had low disk space ( I assume for temporary file use by visual vm), running on a Mac.当我在 Mac 上运行时尝试加载大型堆转储并且磁盘空间不足(我假设用于视觉 vm 的临时文件使用)时,也会出现这些症状。 After I freed up diskspace the file loaded.在我释放磁盘空间后,加载了文件。

I hit a similar snag but realized that there was an exception;我遇到了类似的问题,但意识到有一个例外; it can be hard to spot:很难发现:

在此处输入图片说明

I don't know whether it will always displays an error like that (I'm using v1.3.9).我不知道它是否会一直显示这样的错误(我使用的是 v1.3.9)。

You can try several things:您可以尝试几件事:

  1. Java VisualVM in bundled with JDK 1.6.0_24 is several years old.与 JDK 1.6.0_24 捆绑在一起的 Java VisualVM 已有数年历史。 Try to use latest version from https://visualvm.github.io .尝试使用来自https://visualvm.github.io 的最新版本。
  2. VisualVM uses memory-mapped files so you don't need to start it with 3G heap. VisualVM 使用内存映射文件,因此您无需使用 3G 堆启动它。 I would start with 1G heap.我会从 1G 堆开始。 How much free memory does have your OS when you try to open the heap dump?当您尝试打开堆转储时,您的操作系统有多少可用内存?
  3. There should be progress bar in the right corner of VisualVM, which will show you the progress of loading of the heap. VisualVM 的右上角应该有进度条,它会显示堆加载的进度。 This should give you a clue how long it can take.这应该会给你一个线索,它需要多长时间。

I also noticed if jvisualvm doesn't have permission to read the file, then there is no feedback indicating the problem.我还注意到如果jvisualvm没有读取文件的权限,那么没有反馈表明问题。 (Java 7) (Java 7)

If the opened file is not considered a valid heap dump , the JvisualVM will also be stuck on this screen.如果打开的文件不被视为有效的堆转储,JvisualVM 也将停留在此屏幕上。

Opening the same (invalid) file on MAT (from Eclipse), the error happens:在 MAT(来自 Eclipse)上打开相同(无效)的文件,发生错误:

Error opening heap dump 'heap.hprof'.打开堆转储“heap.hprof”时出错。 Check the error log for further details.检查错误日志以获取更多详细信息。

Not a HPROF heap dump (java.io.IOException)不是 HPROF 堆转储 (java.io.IOException)

Not a HPROF heap dump不是 HPROF 堆转储

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM