QuickTip : How to increase the Java heap memory for Maven 2 on linux

Posted on Thursday, July 26, 2007

17


If you get an error OutOfMemory error while doing mvn site, because of all the reports that you are generating, just increase the heap size for maven2. The way to do that on linux.

In your mvn.sh add this as the first line after the copyright and other comments.

export MAVEN_OPTS=”-Xmx512m”

note than Maven 2.0.6 onwards some users have reported that the double quotes give problems, hence you might want to use

export MAVEN_OPTS=-Xmx512m

Posted in: Java, Maven