I am currently switching from ant to gradle for my multi module web application and at the moment it seems that the current version of Gradle (M9) might be running up agains
If using the Gradle Wrapper you can set DEFAULT_JVM_OPTS
in gradlew
like this:
DEFAULT_JVM_OPTS="-Xmx512m"
Set it in a similar fashion in gradlew.bat
if you're on Windows:
set DEFAULT_JVM_OPTS=-Xmx512m
The Gradle Wrapper task can also be modified to include this automatically. This is how the Gradle developers have solved it:
wrapper {
gradleVersion = '1.8'
def jvmOpts = "-Xmx512m"
inputs.property("jvmOpts", jvmOpts)
doLast {
def optsEnvVar = "DEFAULT_JVM_OPTS"
scriptFile.write scriptFile.text.replace("$optsEnvVar=\"\"", "$optsEnvVar=\"$jvmOpts\"")
batchScript.write batchScript.text.replace("set $optsEnvVar=", "set $optsEnvVar=$jvmOpts")
}
}