Build Failed java.lang.OutOfMemoryError: Java heap space

后端 未结 4 2174
情深已故
情深已故 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:21

    It sounds like you need to launch your JVM with a larger memory limit. Try something like (if you're using Bourne shell):

    export ANT_OPTS=-Xmx1g
    ant
    

    or, if you use cmd under Windows:

    set ANT_OPTS=-Xmx1g
    ant
    

    Above, the 1g means 1 GB. You can tweak that to whatever you like; for example, if you want to use 1.5 GB, you can use -Xmx1536m.

提交回复
热议问题