title: Jmap - Error connecting to remote debug server
body: <p>My requirement is to create a dump file of heap memory of a remote server using Jmap.
  I did this way.</p>
  
  <pre><code>jmap -dump:file=remoteDump.txt,format=b 3104
  </code></pre>
  
  <p>This worked fine as 3104 is the pid of a process from my local machine.
  How do I do the same with remote server?
  I tried</p>
  
  <pre><code>jmap -dump:file=remoteDump.txt,format=b 3104 54.197.228.33:8080
  </code></pre>
  
  <p>But it's failed.
  I tried creating a debug server using jsadebugd, as below.
   1.Started rmiregistry</p>
  
  <blockquote>
    <p>rmiregistry -J-Xbootclasspath/p:$JAVA_HOME/lib/sa-jdi.jar</p>
  </blockquote>
  
  <p>2.Ran jsadebugd</p>
  
  <pre><code>&gt;jsadebugd 11594 54.197.228.33:9009
  </code></pre>
  
  <p>But the step 2 is throwing the following error:</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>Help me get out of it.</p>