title: JVM calltree snapshot for VisualVM
body: <p>I am trying to use <a href="https://visualvm.dev.java.net/" rel="nofollow noreferrer">VisualVM</a> to profile a Java (Sun JDK 1.6) standalone application. I have a scripted performance test environment, where I can run my application and get it to report some metrics I care about. </p>
  
  <p>Is there some way to get JVM to collect some CPU profiling snapshot which I can later analyze with VisualVM?</p>
  
  <p>I am looking for something similar to <code>-XX:+HeapDumpOnOutOfMemoryError</code> flag which writes a heap dump to disk just before an <code>OutOfMemoryError</code> is thrown.</p>