What causes a JRE 6 JVM code cache leak?
        Posted  
        
            by Arturo Knight
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Arturo Knight
        
        
        
        Published on 2009-10-18T21:16:54Z
        Indexed on 
            2010/04/16
            19:13 UTC
        
        
        Read the original article
        Hit count: 600
        
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?
 
© Stack Overflow or respective owner