Fix Javac javalangOutOfMemoryError¶
When javac is compiling a large number of java source files, it may fail with java.lang.OutOfMemoryError:
The system is out of resources. Consult the following stack trace for details. java.lang.OutOfMemoryError: Java heap space
You just need to set environment variable ANT_OPTS:
export ANT_OPTS="-Xms256m -Xmx256m" (ksh/bash) setenv ANT_OPTS="-Xms256m -Xmx256m" (tcsh/csh) set ANT_OPTS="-Xms256m -Xmx256m" (Windows)