This message was deleted.
# community-support
s
This message was deleted.
v
You are configuring the max heap for the Gradle daemon and the one for the Kotlin compile daemon. But you show how a worker process is started, that is unrelated. If you get OOM during a task that uses a worker like test execution or similar, configure the memory for that task.
d
should I use something like this ?
Copy code
tasks.withType(JavaExec) {
    jvmArgs = ['-Xms512m', '-Xmx512m']
}
v
No, you set it as property I think.
d
I did some search and I can only find solution as
Copy code
org.gradle.jvmargs=-Xmx1024m
v
Sorry, that was misleading. Not Project property. Property on the task.
maxHeapSize = "20G"
d
I also did that but same issue
v
Well, is your problem a
JavaExec
task?
JavaExec
tasks have nothing to do with worker process.
d
I have problem with
:compileJava
e
then from looking at https://docs.gradle.org/current/dsl/org.gradle.api.tasks.compile.JavaCompile.html you should try something like
Copy code
tasks.withType(JavaCompile) {
    options.fork {
        memoryMaximumSize = '29G'
    }
}
although that seems like a ludicrous size, try something more reasonable first
☝️ 1
d
Thanks for help, I was able to fix the issue by adding this
Copy code
tasks.withType<JavaCompile> {
    options.isFork = true
    options.fork("memoryMaximumSize" to "25G")
}
👌 1