分析离线 Java 堆转储 (.hprof) 的工具或技巧

发布于 2024-10-05 21:01:20 字数 203 浏览 0 评论 0原文

是否有任何工具允许对 .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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

枕梦 2024-10-12 21:01:20

Eclipse Memory Analyzer 可以满足您所需的一切。

Eclipse Memory Analyzer does everything you need.

很快妥协 2024-10-12 21:01:20

您可以使用 jhat 来解析/导航 < 的内存转储code>.hprof 文件。

$ jhat heapdump.hprof
Reading from heapdump.hprof...

Started HTTP server on port 7000
Server is ready.

该工具随 JDK 一起提供。

You can use jhat to parse/navigate the memory dump of an .hprof file.

$ jhat heapdump.hprof
Reading from heapdump.hprof...

Started HTTP server on port 7000
Server is ready.

The tool comes with the JDK.

茶花眉 2024-10-12 21:01:20

你可以使用 jmap -histo 吗?您想要提取什么类型的报告?

Can you use jmap -histo ? What sort of report are you looking to extract?

话少心凉 2024-10-12 21:01:20

很难击败 yourkit java profiler。虽然要花钱,但每一分钱都是值得的。

hard to beat yourkit java profiler. It costs money, but it is worth every penny.

你列表最软的妹 2024-10-12 21:01:20

另外,如果您使用 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

南风几经秋 2024-10-12 21:01:20

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

谜兔 2024-10-12 21:01:20

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文