From 66ae46ef8b69f310d61d57a44b1b69aeb03222de Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Thu, 26 Nov 2015 02:16:46 -0700 Subject: [PATCH] Give enough ram so javac won't OOM Today its based on the automatic -Xmx, but this will fail in some environments (e.g. vagrant). --- .../src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy index c35ec5cd0f6..4c24710fa23 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy @@ -288,10 +288,12 @@ class BuildPlugin implements Plugin { project.tasks.withType(JavaCompile) { options.fork = true options.forkOptions.executable = new File(project.javaHome, 'bin/javac') + options.forkOptions.memoryMaximumSize = "1g" /* * -path because gradle will send in paths that don't always exist. * -missing because we have tons of missing @returns and @param. */ + // don't even think about passing args with -J-xxx, oracle will ask you to submit a bug report :) options.compilerArgs << '-Werror' << '-Xlint:all,-path' << '-Xdoclint:all' << '-Xdoclint:-missing' options.encoding = 'UTF-8' }