title: Best Tool to collect Java process statistics and Explanation of JMAP
body: <p>I am looking at collecting more detailed java statistics (in plain text format) i.e. statistics that the jstat command emits - like garbage collection data etc. Can anyone please suggest me the best tool to collect the java process statistics like jmap.</p>
  
  <h2>EDIT</h2>
  
  <p>Google gives me advise to use <code>jmap</code> with <code>-histo:live</code> option, but I am not able to understand what information it actually provides. The command I am using is</p>
  
  <pre><code>jmap -histo:live $PID
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code> num     #instances         #bytes  class name
  ----------------------------------------------
     1:         13767        1453320  &lt;constMethodKlass&gt;
     2:         13767        1105416  &lt;methodKlass&gt;
  </code></pre>