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
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”
}
}
}
}
Unfortunately, you have to use reflection (ick), there’s a mixed bag of implementations
I’m sure Kotlin uses different options for it’s compiler daemon however?