2014-03-28 82 views
2

我的需求是使用Jmap创建远程服务器的堆内存转储文件。 我是这样做的。Jmap - 连接远程调试服务器时出错

jmap -dump:file=remoteDump.txt,format=b 3104 

这很好,因为3104是从我的本地机器进程的PID。 如何对远程服务器执行相同的操作? 我试过

jmap -dump:file=remoteDump.txt,format=b 3104 54.197.228.33:8080 

但它失败了。 我尝试使用jsadebugd创建一个调试服务器,如下所示。 1.Started rmiregistry的

rmiregistry -J-Xbootclasspath/p:$JAVA_HOME/lib/sa-jdi.jar

2.Ran jsadebugd

>jsadebugd 11594 54.197.228.33:9009 

但第2步抛出以下错误:

Error attaching to process or starting server: sun.jvm.hotspot.debugger.D 
Exception: Windbg Error: WaitForEvent failed! 
     at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.attach0(Na 
thod) 
     at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.attach(Win 
ggerLocal.java:152) 
     at sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java: 
     at sun.jvm.hotspot.HotSpotAgent.setupDebuggerWin32(HotSpotAgent.j 
) 
     at sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:3 
     at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:313) 
     at sun.jvm.hotspot.HotSpotAgent.startServer(HotSpotAgent.java:220 
     at sun.jvm.hotspot.DebugServer.run(DebugServer.java:106) 
     at sun.jvm.hotspot.DebugServer.main(DebugServer.java:45) 
     at sun.jvm.hotspot.jdi.SADebugServer.main(SADebugServer.java:55) 

帮我把它弄出来。

回答

2

你为什么不重视过程的原因可能是这是所有准备连接到某些debuger或其他视觉机器比你jmap运行执行。

尽量保证过程中不附加任何debuger和你连接到同一个VM。

相关问题