分析离线 Java 堆转储 (.hprof) 的工具或技巧
是否有任何工具允许对 .hprof 文件进行离线分析(包括摘要/排序/筛选)?或者你可以在批处理模式下运行 VisualVM、hat 等吗?
我对可以输入 .hprof 文件、对其进行处理并生成报告的东西感兴趣。
我假设您需要传递一堆选项来配置报告,所以如果您知道任何有用的提示,请权衡一下。
最好是可编写脚本的,这样我就可以一次运行一堆选项。
Are there any tools that allow offline analysis (including summary/sorting/sifting) of an .hprof file? Or can you run VisualVM, hat etc in batch mode?
I'm interested in something that can take an input .hprof file, crunch it and generate reports.
I assume you would need to pass in a bunch of options to configure the report, so if you know any helpful tips, please weigh in.
Preferably scriptable so I could run a bunch at once.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
Eclipse Memory Analyzer 可以满足您所需的一切。
Eclipse Memory Analyzer does everything you need.
您可以使用 jhat 来解析/导航 < 的内存转储code>.hprof 文件。
该工具随 JDK 一起提供。
You can use jhat to parse/navigate the memory dump of an
.hprof
file.The tool comes with the JDK.
你可以使用 jmap -histo 吗?您想要提取什么类型的报告?
Can you use jmap -histo ? What sort of report are you looking to extract?
很难击败 yourkit java profiler。虽然要花钱,但每一分钱都是值得的。
hard to beat yourkit java profiler. It costs money, but it is worth every penny.
另外,如果您使用 IntelliJ IDEA,您也可以打开 *.hprof 内存快照:打开分析器快照 |打开
官方文档:https://www.jetbrains.com/ help/idea/analyze-hprof-memory-snapshots.html
Also, if you use IntelliJ IDEA, you can open *.hprof memory snapshots, too: Run | Open Profiler Snapshot | Open
Official documentation: https://www.jetbrains.com/help/idea/analyze-hprof-memory-snapshots.html
Es MAT (http://www.eclipse.org/mat/) 是正确的选择。检查http://kohlerm.blogspot.com/search/label/memory,特别是< a href="http://kohlem.blogspot.com/2009/07/eclipse-memory-analyzer-10-useful.html" rel="nofollow">http://kohlem.blogspot.com/2009/07/ eclipse-memory-analyzer-10-useful.html
Es MAT (http://www.eclipse.org/mat/) is the way to go. Check http://kohlerm.blogspot.com/search/label/memory, especially http://kohlerm.blogspot.com/2009/07/eclipse-memory-analyzer-10-useful.html
JDK6 附带了 jhat,它可以解析并创建 html 报告。
http://docs.oracle.com/javase/6 /docs/technotes/tools/share/jhat.html
JDK6 comes with jhat which parses and creates an html report.
http://docs.oracle.com/javase/6/docs/technotes/tools/share/jhat.html