title: What causes a JRE 6 JVM code cache leak?
body: <p>Since switching to JRE 6, my server's code cache usage (non-heap) keeps growing indefinitely. My application creates a lot of classes at runtime, BUT these classes are successfully unloaded during the GC process. I can see these classes getting unloaded in the gc logs and also the permGen usage stays constant. I specifically make sure in my code that these classes are orphaned once I am finished with them and so they correctly get garbage collected from permGen.</p>
  
  <p>The code cache however keeps growing. I only became aware of the code cache after switching to JRE 6. So I guess my questions are:</p>
  
  <ol>
  <li>Does GC include the code cache?</li>
  <li>What could cause a code cache memory leak, specifically.</li>
  <li>Is there a bug in JDK 6 in this area?</li>
  </ol>