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

因此,在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

最佳答案

尝试在PID之前放置'-F'选项:

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

10-06 02:05