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)
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.