私の要件は、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)
私がそれから抜け出すのを手伝ってください。