title: How to log heap memory usage in JRuby?
body: <p>To monitor memory usage in the course of a long running JRuby application, I would like to log at certain crucial points the heap memory currently in use. How can I do it?</p>
  
  <p>The closest I found, is <code>GC.stat[:used]</code>, but was does the number stored in this slot really mean? I don't think it denotes the heap memory in bytes, because in my example this is ridiculously high (11000000000.0), and it is a fractional number, which does not make much sense.</p>