jmap打dump异常

背景

    用jmap打dump文件经常遇到如下异常,打不出来,哥今天告拆大家一个终极解决方法,嘘,不要告拆别人。。

Attaching to core -F from executable 421442, please wait...
Error attaching to core file: cannot open binary file
sun.jvm.hotspot.debugger.DebuggerException: cannot open binary file
at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach0(Native Method)
at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach(LinuxDebuggerLocal.java:286)
。。。

解决方法

   在root用户下使用su -m user  -c " command " 搞定。如下:

[root@host11]# su -m yarn -c "jmap -dump:format=b,file=ll.bin 421442"
Dumping heap to /tmp/hsperfdata_yarn/ll.bin ...
Heap dump file created

猜你喜欢

转载自www.cnblogs.com/cwind/p/10335787.html