As of today, my maven compile fails.
[INFO] [ERROR] Unexpected
[INFO] java.lang.OutOfMemoryError: Java heap space
[INFO] at java.util.Arrays.copyOfRange(Arr
I got same problem when compiling Druid.io, increasing the MaxDirectMemorySize finally worked.
export MAVEN_OPTS="-Xms8g -Xmx8g -XX:MaxDirectMemorySize=4096m"
While building the project on Unix/Linux platform, set Maven options syntax as below. Notice that single qoutation signs, not double qoutation.
export MAVEN_OPTS='-Xmx512m -XX:MaxPermSize=128m'
_JAVA_OPTIONS="-Xmx3G" mvn clean install
Using .mvn/jvm.config worked for me plus has the added benefit of being linked with the project.
Increasing the memory size in the environment variable 'MAVEN_OPTS' will help resolve this issue. For me, increasing from -Xmx756M to -Xmx1024M worked.
I got same problem trying to compile "clean install" using a Lowend 512Mb ram VPS and good CPU. Run OutOfMemory and killed script repeatly.
I used export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=350m"
and worked.
Still getting some other compiling failure because is the first time i need Maven, but OutOfMemory problem has gone.