简体   繁体   English

如何使用VisualVM打开大型堆转储?

[英]How do you open large heap dumps using VisualVM?

I created a heap dump using VisualVM. 我使用VisualVM创建了一个堆转储。 The resulting .hprof file is about 6GB. 生成的.hprof文件约为6GB。

When I try to load the file in VisualVM, it gets stuck at 50%. 当我尝试在VisualVM中加载文件时,卡住了50%。 While stuck, no additionaly resources appear to be consumed on the computer I'm using. 卡住时,似乎没有其他资源在我正在使用的计算机上消耗。 CPU is quiet, only about half of the available memory is in use, and there isn't any IO being reported. CPU安静,只有大约一半的可用内存正在使用,并且没有任何IO的报告。

jvisualvm: Stuck on “Loading Heap Dump” screen asks a similar question, but the only answer suggests creating the .hprof file through VisualVM (which I already did). jvisualvm:停留在“加载堆转储”屏幕上时,提出了类似的问题,但是唯一的答案是建议通过VisualVM创建.hprof文件(我已经这样做了)。

Are there any special settings I need to use to open a heap dump of this size? 我需要使用任何特殊设置来打开这种大小的堆转储吗?

I suggest you to open it with MAT Eclipse Memory Analyzer , its a powerful tool to analyze that kind of Heap dump files, beside its the common way to analyze Heap files. 我建议您使用MAT Eclipse内存分析器打开它,它是分析那种堆转储文件的强大工具,它是分析堆文件的常用方法。

Also you need to increase MAT memory in order to open that big size file, you can do that as the following: 另外,您需要增加MAT内存才能打开大文件,您可以按照以下步骤进行操作:

  1. Open config.ini file that located in MAT_HOME directory. 打开位于MAT_HOME目录中的config.ini文件。
  2. Change the value of -Xmx to more than 6GB . -Xmx的值更改为6GB

The Above Link contain also a tutorial to how to use MAT . 上述链接还包含有关如何使用MAT的教程。

If MAT won't open the Heap file, then the file is probably corrupted. 如果MAT无法打开Heap文件,则该文件可能已损坏。

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

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