运行jmap获取无法打开套接字文件

运行jmap获取无法打开套接字文件

我必须运行jmap才能获取我的进程的堆转储。但jvm回来了:

Unable to open socket file: target process not responding or HotSpot VM not loadedThe -F option can be used when the target process is not responding

所以我使用了-F

./jmap -F -dump:format=b,file=heap.bin 10330Attaching to process ID 10331, please wait...Debugger attached successfully.Server compiler detected.JVM version is 24.51-b03Dumping heap to heap.bin ...
  1. 使用-F 是可以进行堆转储吗?

  2. 我等了20分钟还没完呢。有什么想法吗?


肥皂起泡泡
浏览 1860回答 3
3回答

aluckdog

我刚刚发现jmap(当使用它来生成堆转储时可能是jvisualvm)强制运行jmap的用户必须是运行尝试转储的进程的同一用户。在我的情况下,我希望堆转储的jvm由linux用户“jboss”运行。所以在哪里sudo jmap -dump:file.bin <pid>报告“无法打开套接字:”,我能够使用以下方法获取我的堆转储:sudo&nbsp;-u&nbsp;jboss&nbsp;jmap&nbsp;-dump:file.bin&nbsp;<pid>
打开App,查看更多内容
随时随地看视频慕课网APP