Build Failed java.lang.OutOfMemoryError: Java heap space

后端 未结 4 2100
情深已故
情深已故 2021-01-31 09:21

I am facing this issue while building my build.xml.

BUILD FAILED
java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:2786)
            


        
4条回答
  •  太阳男子
    2021-01-31 10:02

    (For < Java 8, permgen doesn't apply to Java 8 and up)

    For benefit of those who got a similar trace with the word "PermGen" in the Error message,

    java.lang.OutOfMemoryError: PermGen space
    

    Increasing the perm-gean space in ANT_OPTS (preferably, though not necessarily along with the Max heap size) should solve the issue

    example

    export ANT_OPTS="-Xmx2g -XX:MaxPermSize=512m"
    

    Adjust the numbers as per your your need.

    Cheers!

提交回复
热议问题