Is there any way to monitor the compiled code cache in Java?
<p>OK - I know I can run my java process like this :</p>

<pre><code>java -XX:+PrintCompilation &lt;FooProgram&gt;
</code></pre>

<p>and I can see output like:</p>

<pre><code>c:\&gt;java -XX:+PrintCompilation -jar c:\FooProgram.jar
  1       java.lang.String::charAt (33 bytes)
  2       java.lang.Math::max (11 bytes)
  1%      java.util.jar.JarFile::hasClassPathAttribute @ 78 (197 bytes)
  3       java.lang.String::hashCode (60 bytes)
  4       java.lang.String::indexOf (151 bytes)
  5       java.util.Properties$LineReader::readLine (452 bytes)
  6       java.lang.Object::&lt;init&gt; (1 bytes)
  7       java.lang.String::indexOf (166 bytes)
  8       java.lang.String::equals (88 bytes)
</code></pre>

<p>to give me an idea of what methods are compiled, uncompiled, marked as zombies, etc.  Is there anyway to monitor the usage of the code cache where these methods get compiled into?  I see a message when the compiler code cache is full saying something like: "I'm full, no more compilations for you...", but it would seem as though something like this is a lagging indicator that we have a problem.  I know how to print the max size of the code cache, what I'm looking for really is a way to see how its being filled up over time.</p>
