Hi all, I’m investigating some memory issues with our rather large Android build. I have couple of questions about possible memory usage with different options.
From what I understand,
org.gradle.workers.max property will limit number of total worker processes Gradle spawns. Does this include jvms forked to run tests, JavaCompile task, dex etc.?
Second question is about
org.gradle.jvmargs property – does it affect only Gradle client? My understanding is that yes, and that’s why e.g. test task has its own max heap settings. Does that mean maximum memory usage might be equal to
max_workers * heaviest_task_usage, assuming the build can parallelize heaviest task enough to run it max_worker times? And then we’d have to limit each of those tasks, or reduce parallelism?
Do you have any pointers in general to identify proper combination of options to avoid oom errors? For example our machines have 64 cores (build scan shows max 64 workers), would it be possible that too many tasks are run in parallel for which jvm follows different settings than
org.gradle.jvmargs, thus depleting the memory? I’m pretty sure 64 is way overkill anyway. Or maybe is there some way to identify heavy jvm forks?
Thanks for any help!