Tag Archives: surefire

Maven Surefire PermGen error

In case you are getting PermGen error while running tests using the Maven Surefire plugin, here is the solution:

    <argLine>-Xmx512m -XX:MaxPermSize=256m</argLine>

Setting the JVM args as part of the plugin did the trick!

Setting MAVEN_OPTS would not help because Maven Surefire plugin forks the JVM process while running the tests, and so the MAVEN_OPTS settings do not take effect.