-XX:MaxPermSize with or without -XX:PermSize

We’ve run into a Java.lang.OutOfMemoryError: PermGen space error and looking at the tomcat JVM params, other than the -Xms and -Xmx params we also specify -XX:MaxPermSize=128m. After a bit of profiling I can see occasionally garbage collection happening on the PermGen space saving it from running full.

My question is: other than increasing the -XX:MaxPermSize what would be the difference if I specify as well -XX:PermSize? I know the total memory then would be Xmx+maxPermSize but is there any other reason why -XX:PermSize should not be there when -XX:MaxPermSize is specified?

Please do share if you have real-world experience dealing with these JVM parameters.

ps. The JVM is HotSpot 64bit Server VM build 16.2-b04

Leave a Comment