I am building a Maven Java app on a Jenkins build server. I am running into java.lang.OutOfMemoryError: PermGen space
many times during the build on Jenkins (but never on my localhost) and hence it fails my build.
I have already tried setting MAVEN_OPTS
for Jenkins: I went into Jenkins
-->Manage Jenkins
-->Configure system
-->Global MAVEN_OPTS
and it was set to -Xms512m -Xmx1024m -XX:MaxPermSize=512m -XX:PermSize=512m
. Despite setting it to this high value, we keep running into the PermGen space issues. I don't want to set the MAVEN_OPTS to a higher value; I do not see how my app can require a gig of space, and I'd rather dig deep into the high-memory-usage problem.
Lately, I've been thinking that perhaps the permgen space issue is NOT coming from Maven itself but rather one of the JVM processes that Maven spins off (ex: plugins). I propose this hypothesis because Maven is still able to execute TestNG tests alright, despite already spitting our the permgen space error lines. One such plugin that is causing the PermGen error is Jetty:
Oct 31, 2012 7:55:37 AM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: handle failed
java.lang.OutOfMemoryError: PermGen space
Hence, I would like to know:
Does the MAVEN_OPTS
variable also apply to child JVM processes that a Maven build spins off? If not, then how do I set the JVM options for these child processes such as Jetty?
NOTE: I am using Maven 3.0.4.
mvn gae:run
, which is the maven-gae-plugin. – Kingcup