jw: using the daemon will limit the heap size to 1GB. Without, it’ll run without an Xmx. We tend to use the daemon for that reason, and also constrain the maximum heap sizes of compiler daemons for Java/Groovy etc with something like this
danny
05/31/2017, 4:19 PM
with(project) {
afterEvaluate {
tasks.filter { it is AbstractCompile }.forEach {
val hasOptions = it
.javaClass
.declaredMethods
.filter { it.name == “getOptions” && it.returnType == CompileOptions::class.java }
.isNotEmpty()
if (hasOptions) {
val options = it.javaClass.getDeclaredMethod(“getOptions”).invoke(it) as CompileOptions
options.forkOptions.memoryMaximumSize = “1024m”
}
}
}
}
danny
05/31/2017, 4:19 PM
Unfortunately, you have to use reflection (ick), there’s a mixed bag of implementations
danny
05/31/2017, 4:20 PM
I’m sure Kotlin uses different options for it’s compiler daemon however?