Search code examples
javamavenpermgen

PermGen settings not taking effect


I'm trying to increase the amount of PermGen space my application has to avoid some PermGen errors.

I've tried exporting both JAVA_OPTS and MAVEN_OPTS as

-Xms1024m -Xmx2048m -XX:PermSize=1024m -XX:MaxPermSize=2048m -XX:+CMSClassUnloadingEnabled  -XX:+CMSPermGenSweepingEnabled

But jconsole still shows the "CMS Perm Gen" maximum to be:

Max: 83,968 kbytes

and the application still runs out of PermGen space when it hits this.


Solution

  • have you tried adding those options to your pom - under the surefire plugin configuration as you have to tell surefire about these opts explicitly

    <argLine>-Xms1024m -Xmx2048m -XX:PermSize=1024m -XX:MaxPermSize=2048m -XX:+CMSClassUnloadingEnabled</argLine>