从命令行进行 OpenJDK 核心转储?

发布于 2024-10-24 04:41:17 字数 871 浏览 5 评论 0原文

谁能给我提示我做错了什么?

因此,在 Redhat(Amazon AMI 实例)上,我尝试获取正在运行的应用程序的核心转储。即使远程端口完全打开(并且 JMX 服务器已正确配置),我也无法从 Windows 盒子中的 jconsole.exe 或 jvisualvm.exe 连接到 JMX 端口。我不知道为什么,所以我试图直接从 JVM 获取核心转储(Cntrl-\ 不起作用)。所以,这就是我如何设置来获取核心转储,但它不起作用,我不知道为什么。

[ec2-user bin]$
jsadebugd 2504 -F Attaching to process
ID 2504 and starting RMI services,
please wait... Debugger attached and
RMI services started.

因此,在调试器运行后,我尝试使用它创建转储,但失败了:

[ec2-user ~]$ jmap -dump:live,format=b,file=dump.t 2504 
2504: Unable to open socket file:
target process not responding or
HotSpot VM not loaded The -F option
can be used when the target process is
not responding

[ec2-user ~]$ jmap -dump:live,format=b,file=dump.t 2504 -F 
Attaching to core -F from 
executable 2504, please wait... Error
attaching to core file: Can't attach
to the core file

Can anyone give me a hint to what I am doing wrong?

So, on Redhat (Amazon AMI Instance) , I am trying to get a core dump of my running application. I am unable to connect to the JMX port from jconsole.exe or jvisualvm.exe from a windows box even though the remote port is wide open (and JMX server is properly configured). I don't know why, and so I am trying to get a core dump from the JVM directly (Cntrl-\ didnt work). So, here is how I set things up to get the core dump, but it doesn't work and I don't know why.

[ec2-user bin]$
jsadebugd 2504 -F Attaching to process
ID 2504 and starting RMI services,
please wait... Debugger attached and
RMI services started.

So, after the debugger is running, I try to create the dump using this, but it fails:

[ec2-user ~]$ jmap -dump:live,format=b,file=dump.t 2504 
2504: Unable to open socket file:
target process not responding or
HotSpot VM not loaded The -F option
can be used when the target process is
not responding

[ec2-user ~]$ jmap -dump:live,format=b,file=dump.t 2504 -F 
Attaching to core -F from 
executable 2504, please wait... Error
attaching to core file: Can't attach
to the core file

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

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

发布评论

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

评论(1

白龙吟 2024-10-31 04:41:17

尝试将“-F”选项放在 PID 之前:

jmap -dump:live,format=b,file=dump.t -F 2504

Try placing the '-F' option before PID:

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