Peter Ledbrook wrote:
Hi,
The Gradle build for Grails is currently running out of memory during
the compile phase:
:clean
:build/script-classes
:init
:resources
:compile
a serious error occurred: Java heap space
stacktrace:
java.lang.OutOfMemoryError: Java heap space
Build failed with an exception.
Run with -s or -d option to get more details. Run with -f option to
get the full (very verbose) stacktrace.
Build file '/home/pal20/dev/tools/git/grails-trunk/build.gradle'
Execution failed for task :compile.
Cause: Forked groovyc returned error code: 1
BUILD FAILED
I have upped the maximum heap size to 512Mb via GRADLE_OPTS="-Xmx512m
-XX:MaxPermSize=128m", but it seems this setting isn't being passed to
the forked compiler. Any ideas?
The GroovyCompile task does not use $GRADLE_OPTS when forking the
groovyc compiler. Instead, you need to set the fork options for the
task. For example:
compile.groovyOptions.fork(memoryMaximumSize: '512m')
Adam