Wednesday, September 09, 2009

Maven Out of Memory Errors

We have seen some Maven errors compiling the OGCE portal on Mac OS X 10.5 with Java 1.6. To remedy this, set the MAVEN_OPTS environment variable:

(bash) export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m"
(csh) setenv MAVEN_OPTS "-Xmx1024m -XX:MaxPermSize=128m"

The actual values (1024m and 128m) can be varied if necessary.

The error message output from running "mvn clean install" is shown below.

[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
Failure executing javac, but could not parse the error:

The system is out of resources.
Consult the following stack trace for details.
java.lang.OutOfMemoryError: Java heap space