We have a PermGen Out of memory exception in our Java EE web application:
java.lang.OutOfMemoryError: PermGen space
We have read so many posts about how to solve it and almost all of them say that we have to increase PermSize (default and maximum). But we are not able to change them. We have tried to modify setenv.sh, catalina.sh and startup.sh adding this code:
export JAVA_OPTS="-XX:PermSize=M -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled"
And we also try to do it using the terminal:
export JVM_ARGS="-XX:PermSize=256m-XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled"
But when we check it using "jstat -gcpermcapacity " nothing changes; the memory is always the same. Our enviroment is Centos 6, Apache 2.2, Tomcat 5.5, Java 6 and we have done our app deploy installing servlets by WHM in our account.