Monday, April 05, 2010

Maven java.lang.OutOfMemoryError: Java heap space

Days ago our deployment scripts started to fail for some packages with error:
java.lang.OutOfMemoryError: Java heap space

It was solved adding the below to pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.2</version>
<configuration>
<argLine>-Xmx1024m</argLine>
</configuration>
</plugin>

However tonight it happened again. The build was taking too long and when inspecting the java process it was not launched with -Xmx1024m option so the below did the trick:
export MAVEN_OPTS=-Xmx1024m

No comments:

Followers