title: How to profile a headless Java application, running remotely?
body: <p>I have a headless Java application, running on a remote server as a daemon-style process.</p>
  
  <p>I want to extract Java level profiling information from the process, of the sort displayed by <a href="http://visualvm.java.net/">JVisualVM</a>. For example, it should show method invocation times and so on.</p>
  
  <p>What is the best way of doing this? My understanding is that JVisualVM does not profile when connecting remotely.</p>
  
  <p>Ideally, the profiling information would be stored in a file for later inspection, in a manner similar to Java heap generation (with jmap) and later analysis (with a heap inspector).</p>