`

linux下用jmap命令进行堆栈转储

阅读更多
在linux下,命令和windows下一样,用root用户输入以下命令:

jmap -dump:format=b,file=/filepath/heap.bin pid

结果报错:

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

上网搜了一下,是因为目标进程是另一个用户启动的,所以用root用户就jmap不了,换启动进程的那个用户就行了

第2次如果再次用root用户输入这个命令,会报另一个错误:

well-known file is not secure

原因也是一样,目标进程是哪个用户启动的,就要用哪个用户来执行jmap命令
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics