Maven Out of Memory Build Failure

前端 未结 13 1092
情歌与酒
情歌与酒 2020-11-29 18:37

As of today, my maven compile fails.

[INFO] [ERROR] Unexpected
[INFO] java.lang.OutOfMemoryError: Java heap space
[INFO]  at java.util.Arrays.copyOfRange(Arr         


        
相关标签:
13条回答
  • 2020-11-29 19:25

    I got same problem when compiling Druid.io, increasing the MaxDirectMemorySize finally worked.

    export MAVEN_OPTS="-Xms8g -Xmx8g -XX:MaxDirectMemorySize=4096m"
    
    0 讨论(0)
  • 2020-11-29 19:28

    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'
    
    0 讨论(0)
  • 2020-11-29 19:29
    _JAVA_OPTIONS="-Xmx3G" mvn clean install
    
    0 讨论(0)
  • 2020-11-29 19:33

    Using .mvn/jvm.config worked for me plus has the added benefit of being linked with the project.

    0 讨论(0)
  • 2020-11-29 19:33

    Increasing the memory size in the environment variable 'MAVEN_OPTS' will help resolve this issue. For me, increasing from -Xmx756M to -Xmx1024M worked.

    0 讨论(0)
  • 2020-11-29 19:38

    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.

    0 讨论(0)
提交回复
热议问题