从命令行打开OpenJDK核心转储?

时间:2011-03-18 21:55:29

标签: java debugging core

任何人都可以暗示我做错了吗?

所以,在Redhat(Amazon AMI Instance)上,我试图获得正在运行的应用程序的核心转储。即使远程端口是全开的(并且JMX服务器已正确配置),我也无法从jboxsole.exe或jvisualvm.exe从Windows框连接到JMX端口。我不知道为什么,所以我试图直接从JVM获得核心转储(Cntrl- \ didnt工作)。所以,这是我如何设置以获得核心转储,但它不起作用,我不知道为什么。

[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

1 个答案:

答案 0 :(得分:5)

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

jmap -dump:live,format=b,file=dump.t -F 2504
相关问题