java 如何读取由 jconsole 创建的堆转储文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7219128/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to read heap dump file which is created by jconsole?
提问by u290629
I performed a heap dump manually by invoking the com.sun.management.HotSpotDiagnosticMXBean's dumpHeapoperation in jconsole. So I got a dump file.
我通过在 jconsole 中调用com.sun.management.HotSpotDiagnosticMXBean 的dumpHeap操作来手动执行堆转储。所以我得到了一个转储文件。
My question: Can jconsole read the dump file? If not, which tool can read it? Thanks!
我的问题:jconsole 可以读取转储文件吗?如果没有,哪个工具可以读取它?谢谢!
EDIT: Now I know jconsole doesn't provide read feature, I am wondering reason why jconsole only writes dump file without read feature. (This is not my question, I am just curoius about it)
编辑:现在我知道 jconsole 不提供读取功能,我想知道为什么 jconsole 只写入没有读取功能的转储文件。(这不是我的问题,我只是对此感到好奇)
回答by Newbie
You can use jvisualvm.exe which comes with JDK 1.5 and above. Its present in bin folder of JDK. This is a very good tool which can be used to profile even the running Java applications. You can even use JProfilerto read heap dump files. But this software is licensed.
您可以使用 JDK 1.5 及更高版本附带的 jvisualvm.exe。它存在于JDK的bin文件夹中。这是一个非常好的工具,甚至可以用来分析正在运行的 Java 应用程序。您甚至可以使用JProfiler来读取堆转储文件。但是这个软件是有授权的。
回答by u290629
I found an Eclipse plugin Memory Analyzerto read the dump file by myself. Other tools are still welcome.
我找到了一个Eclipse插件Memory Analyzer来自己读取转储文件。其他工具仍然受欢迎。