It's a familiar old problem but I really want to put it to bed once and for all! I've got the following JVM flags set:
-XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenSweepingEnabled -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=true
but I still observe the permgen usage notch up by a good 50MBs for every deployment cycle. I'm deploying remotely using the Tomcat manager application, and Grails is in production mode.
If it gets too full then a kill -9
is necessary!
I might try using JRockit but nor now it's not an option. I don't really find it acceptable in a production environment to have to bounce the whole container every once in a while.