如何分析 Java 核心转储中的信息?

发布于 2024-07-23 18:36:12 字数 1539 浏览 6 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(10

如何视而不见 2024-07-30 18:36:13

好吧,如果您使用 gcore 或 gdb 创建了核心转储,那么您需要将其转换为名为 HPROF 文件。 这些可以由 VisualVM、Netbeans 或 Eclipse 的内存分析器工具(以前称为 SAP 内存分析器)使用。 我推荐 Eclipse MAT。

要转换文件,请使用命令行工具jmap

# jmap -dump:format=b,file=dump.hprof /usr/bin/java core.1234

其中:

dump.hprof 是您要创建的 hprof 文件的名称

/usr/bin/java 是生成核心转储的 java 二进制文件版本的路径

core.1234 是您的常规文件核心文件。

Okay if you've created the core dump with gcore or gdb then you'll need to convert it to something called a HPROF file. These can be used by VisualVM, Netbeans or Eclipse's Memory Analyzer Tool (formerly SAP Memory Analyzer). I'd recommend Eclipse MAT.

To convert the file use the commandline tool jmap.

# jmap -dump:format=b,file=dump.hprof /usr/bin/java core.1234

where:

dump.hprof is the name of the hprof file you wish to create

/usr/bin/java is the path to the version of the java binary that generated the core dump

core.1234 is your regular core file.

被翻牌 2024-07-30 18:36:13

如果您使用的是 IBM JVM,请下载 IBM 线程和监视器转储分析器。 这是一个很好的工具。 它提供了线程详细信息,并可以指出死锁等。以下博客文章提供了一个很好的概述如何使用它。

If you are using an IBM JVM, download the IBM Thread and Monitor Dump Analyzer. It is an excellent tool. It provides thread detail and can point out deadlocks, etc. The following blog post provides a nice overview on how to use it.

旧梦荧光笔 2024-07-30 18:36:13

也许 VisualVM 可以提供帮助(我自己还没有机会尝试)。 链接:

http://java.sun.com/javase /6/docs/technotes/guides/visualvm/coredumps.html

Maybe VisualVM can help (haven't yet had a chance to try it myself). Link:

http://java.sun.com/javase/6/docs/technotes/guides/visualvm/coredumps.html

泪意 2024-07-30 18:36:13

您确定核心转储是您想要的吗? 它将包含正在运行的 JVM 的原始内容,而不是 java 级别的信息。 也许 JVM 堆转储更适合您。

Are you sure a core dump is what you want here? That will contain the raw guts of the running JVM, rather than java-level information. Perhaps a JVM heap dump is more what you need.

萌梦深 2024-07-30 18:36:13

实际上,VisualVM 可以处理应用程序核心转储。

只需调用“文件/添加 VM Coredump”即可在应用程序资源管理器中添加一个新应用程序。 然后,您可以获取该 JVM 的线程转储或堆转储。

Actually, VisualVM can process application core dump.

Just invoke "File/Add VM Coredump" and will add a new application in the application explorer. You can then take thread dump or heap dump of that JVM.

各自安好 2024-07-30 18:36:13

请参阅 http://www.oracle.com/technetwork/java/ javase/tsg-vm-149989.pdf。 您可以直接在核心文件上使用“jdb”。

See http://www.oracle.com/technetwork/java/javase/tsg-vm-149989.pdf. You can use "jdb" directly on the core file.

乙白 2024-07-30 18:36:13

尝试 lady4j 堆栈分析器,它可以帮助您:

http://www.lady4j.com/solveStack.jsp

Try the lady4j stack analyzer, it could help you:

http://www.lady4j.com/solveStack.jsp

原谅过去的我 2024-07-30 18:36:13

IBM 提供了许多也可以在 sun jvm 上使用的工具。 看看alphaworks上的一些项目,他们提供了堆和线程转储分析器

Karl

IBM provide a number of tools which can be used on the sun jvm as well. Take a look at some of the projects on alphaworks, they provide a heap and thread dump analyzers

Karl

触ぅ动初心 2024-07-30 18:36:13

我建议您尝试 Netbeans Profiler。它拥有丰富的真实工具集时间分析。
IbM 的工具值得尝试用于离线分析

I recommend you to try Netbeans Profiler.It has rich set of tools for real time analysis.
Tools from IbM are worth a try for offline analysis

奶茶白久 2024-07-30 18:36:13

jhat 是迄今为止我用过的最好的之一。要进行核心转储,我认为您最好使用 jmap 和 jps 而不是 gcore(我没有使用过)。检查链接以了解如何使用 jhat。
http://www.lshift.net/blog/2006/03/08/java-memory-profiling-with-jmap-and-jhat" lshift.net/blog/2006/03/08/java-memory-profiling-with-jmap-and-jhat

jhat is one of the best i have used so far.To take a core dump,I think you better use jmap and jps instead of gcore(i haven't used it).Check the link to see how to use jhat.
http://www.lshift.net/blog/2006/03/08/java-memory-profiling-with-jmap-and-jhat

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