What causes a JRE 6 JVM code cache leak?
- by Arturo Knight
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.
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:
Does GC include the code cache?
What could cause a code cache memory leak, specifically.
Is there a bug in JDK 6 in this area?