Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(10)
好吧,如果您使用 gcore 或 gdb 创建了核心转储,那么您需要将其转换为名为 HPROF 文件。 这些可以由 VisualVM、Netbeans 或 Eclipse 的内存分析器工具(以前称为 SAP 内存分析器)使用。 我推荐 Eclipse MAT。
要转换文件,请使用命令行工具jmap。
其中:
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.
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.
如果您使用的是 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.
也许 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
您确定核心转储是您想要的吗? 它将包含正在运行的 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.
实际上,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.
请参阅 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.
尝试 lady4j 堆栈分析器,它可以帮助您:
http://www.lady4j.com/solveStack.jsp
Try the lady4j stack analyzer, it could help you:
http://www.lady4j.com/solveStack.jsp
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
我建议您尝试 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
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