将核心文件转储转换为堆转储

发布于 2025-01-17 03:09:57 字数 903 浏览 2 评论 0原文

我从一台机器上获取了一个核心转储文件,文件大小为 2GB。我可以使用 gdb 打开该文件,并查看获取核心文件时正在运行的进程。我想将此文件转换为堆转储,以便查看更多有用的信息。我尝试运行以下命令但没有成功。有谁知道为什么文件没有转换为堆转储?我该如何执行此操作?

我尝试了以下命令,但出现错误并且从未创建文件。

jmap -heap:format=b file=jvmcore.hprof /usr/lib/jvm/jdk1.5.0_22/ jvm.core 用法:jmap \[option\] \; (连接到实时 java 进程)或 jmap \[option\] \; \<核心\> (连接到核心文件)或 jmap \[option\] \[server_id@\]\<远程服务器 IP 或主机名\> (连接到远程调试服务器)其中选项必须是以下之一:\<无选项\>打印与 Solaris pmap 相同的信息 \-heap 打印 java 堆摘要 \-heap:format=b 以 hprof 二进制格式转储 java 堆 \-histo 打印 java 对象堆的直方图 \-permstat 打印永久代统计信息 \-小时 | -help 打印此帮助消息

与上面我使用以下命令得到的结果相同:

jmap -heap:format=b file=jvmcore.hprof /usr/lib/jvm/jdk1.5.0_11/ jvm .core

并且尝试此命令会出现错误:

jmap -heap:format=b file=jvmcore.hprof jvm.core 从可执行文件附加到核心 jvm.core file=jvmcore.hprof,请稍候...附加到核心文件时出错:无法附加到核心文件

I have an taken a core dump file from a machine, with file size 2GB. I can open this file with gdb and see the processes that were running when I took the core file. I want though to convert this file into a heap dump in order to see more useful information. I tried running the below commands without any success. Does anyone have an idea why the file is not converted into heap dump? How can I perform this action?

I tried the bellow commands but I get errors and the file never is being created.

jmap -heap:format=b file=jvmcore.hprof /usr/lib/jvm/jdk1.5.0_22/ jvm.core Usage: jmap \[option\] \<pid\> (to connect to a live java process) or jmap \[option\] \<executable\> \<core\> (to connect to a core file) or jmap \[option\] \[server_id@\]\<remote server IP or hostname\> (to connect to a remote debug server) where option must be one of: \<no option\> to print same info as Solaris pmap \-heap to print java heap summary \-heap:format=b to dump java heap in hprof binary format \-histo to print histogram of java object heap \-permstat to print permanent generation statistics \-h | -help to print this help message

Same result as above i got with the following command:

jmap -heap:format=b file=jvmcore.hprof /usr/lib/jvm/jdk1.5.0_11/ jvm.core

And trying this command gets an error:

jmap -heap:format=b file=jvmcore.hprof jvm.core Attaching to core jvm.core from executable file=jvmcore.hprof, please wait... Error attaching to core file: Can't attach to the core file

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文