我有一个Java应用程序,我从控制台运行,然后控制台执行另一个Java进程.我想获得该子进程的线程/堆转储.
在Unix上,我可以做一个kill -3 <pid>但是在Windows AFAIK上获取线程转储的唯一方法是在控制台中使用Ctrl-Break.但这只会让我转移父进程,而不是孩子.
有没有另一种方法来获得堆转储?
我必须运行jmap才能获取我的进程的堆转储.但jvm回来了:
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
Run Code Online (Sandbox Code Playgroud)
所以我使用了-F:
./jmap -F -dump:format=b,file=heap.bin 10330
Attaching to process ID 10331, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 24.51-b03
Dumping heap to heap.bin ...
Run Code Online (Sandbox Code Playgroud)
-F 是可以进行堆转储吗?