title: How to get Java profiling dump for creating flame graphs on the mac?
body: <p>I'd like to collect stacktraces from my Java app for creating <a href="http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html" rel="nofollow noreferrer">CPU Flame Graphs</a> for profiling.</p>
  
  <p>This is very similar to this question: <a href="https://stackoverflow.com/questions/10333376/how-to-get-complete-stack-dump-from-profiler-in-every-sample-for-use-in-flame-gr">How to get complete stack dump from profiler in every sample for use in flame graph?</a> with 2 differences:</p>
  
  <ol>
  <li>I work with Java code and I need Java stacktraces</li>
  <li>I'm working on Mac (this means there is no <code>pref</code> and AFAIK <code>dtrace</code> on OSX doesn't support <code>jstack</code>extension).</li>
  </ol>
  
  <p>I have already tried <a href="https://code.google.com/p/lightweight-java-profiler/" rel="nofollow noreferrer">lightweight-java-profiler</a> and <a href="https://github.com/RichardWarburton/honest-profiler" rel="nofollow noreferrer">Honest profiler</a>, and both of them don't seem to work on Mac. I also Tried <a href="http://visualvm.java.net" rel="nofollow noreferrer">VisualVM</a>, but I couldn't get it to produce the stacktrace dumps that I needed.</p>
  
  <p>First prioirty for me are flame graphs generated from Java stacktraces, but having the native call stack as well would be great, because it would let me address the I/O issues (and maybe even generate <a href="http://www.brendangregg.com/FlameGraphs/hotcoldflamegraphs.html" rel="nofollow noreferrer">hot/cold flame graphs</a>).</p>