【问题标题】:Jmap - Error connecting to remote debug serverJmap - 连接到远程调试服务器时出错
【发布时间】:2014-03-28 09:13:17
【问题描述】:

我的要求是使用 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.启动rmiregistry

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

2.运行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)

帮助我摆脱困境。

【问题讨论】:

    标签: jmap


    【解决方案1】:

    您无法附加到进程的原因可能是它已经附加到某个其他调试器或在其他可视机器上执行,而不是您的 jmap 正在运行。

    尽量确保该进程未附加到任何调试器,并且您附加到同一个 VM。

    【讨论】:

      猜你喜欢
      • 2018-09-22
      • 2012-09-19
      • 2018-07-16
      • 2018-03-25
      • 2016-01-22
      • 2012-09-06
      • 2014-01-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多