title: Get heap dump from a remote application in Java using JVisualVM
body: <p>I run JVisualVM (Windows XP, Sun Java 1.6.0.13, 32 bit client VM) to monitor a distant application (Linux, Sun Java 1.6.0.07, 64 bit server VM). Before starting the actual remote application, I launch on the remote machine <code>jstatd</code> using an all access policy:</p>
  
  <pre><code>grant codebase "file:${java.home}/../lib/tools.jar" {
     permission java.security.AllPermission;
  };
  </code></pre>
  
  <p>Then I start the actual app using the command line</p>
  
  <pre><code> java -Dcom.sun.management.jmxremote.authenticate=false 
  -Dcom.sun.management.jmxremote.ssl=false 
  -Dcom.sun.management.jmxremote.port=3333 
  compileTest.Main
  </code></pre>
  
  <p>From the client machine, I can see the distant app and monitor it. I can also make a thread dump etc. Unfortunately, the heap-dump button is grayed out. </p>
  
  <p>How can I obtain a heap-dump from a remotely monitored application using JVisualVM?</p>
  
  <p>I tried using jConsole. With jConsole it is possible to make a <em>distant</em> heap dump using the com.sun.management.HotSpotDiagnostic dumpHeap operation. I want the dump to be transferred to the client side and analyzed using the tools provided by JVisualVM. How can I do this?</p>