Class Unloading in Java's G1 Garbage Collector (G1GC)
问题 In Java 6 we used to use the following GC configuration to prevent Perm Gen OutOfMemoryException after several redeployments of our app: -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled We're moving to Java 7 and want to use the new G1 GC, which from what I've read, moves the classes from the PermGen in Java memory to native memory. Is there some flag to enable unloading unused classes? 回答1: The G1 performs the class unloading during a Full GC, so you do not need to specify any