Robert Jaros
01/22/2025, 7:06 PMRobert Jaros
01/22/2025, 7:08 PMOleg Yukhnevich
01/23/2025, 10:28 AMorg.gradle.workers.max=2
to limit parallelism, but it will affect not only Dokka, so it's more of a last resort, if needed
BTW, is your project opensource?Robert Jaros
01/23/2025, 10:30 AMRobert Jaros
01/23/2025, 10:33 AMWhich heap you were increasing? Dokka execution or Gradle's?I have added:
dokkaGeneratorIsolation.set(ProcessIsolation {
maxHeapSize.set("12g")
})
to all modules, and yes, it seems all modules are generated in parallel.Oleg Yukhnevich
01/23/2025, 10:54 AMOleg Yukhnevich
01/23/2025, 10:55 AMClassloaderIsolation
might be a better choice regarding memory consumption - because it will not spawn separate processes, and so will use just Gradle heapRobert Jaros
01/23/2025, 11:24 AMClassloadedIsolation
and with Gradle heap set to 6GB
it fails after a few minutes with:
> Task :modules:kilua-trix:dokkaGenerateModuleHtml FAILED
The Daemon will expire after the build after running out of JVM heap space.
The project memory settings are likely not configured or are configured to an insufficient value.
The daemon will restart for the next build, which may increase subsequent build times.
These settings can be adjusted by setting 'org.gradle.jvmargs' in 'gradle.properties'.
The currently configured max heap space is '6 GiB' and the configured max metaspace is 'unknown'.
but there are still other tasks running, CPU at 100%, load avg ~10.Robert Jaros
01/23/2025, 11:28 AMRobert Jaros
01/23/2025, 11:29 AMRobert Jaros
01/23/2025, 11:58 AMjava.lang.OutOfMemoryError: Java heap space
on 8GBRobert Jaros
01/23/2025, 12:40 PMRobert Jaros
01/23/2025, 1:02 PM-9
signal.Robert Jaros
01/23/2025, 1:02 PMRobert Jaros
01/23/2025, 1:29 PMOleg Yukhnevich
01/23/2025, 1:34 PMRobert Jaros
01/23/2025, 1:34 PMRobert Jaros
01/23/2025, 2:09 PMProcessIsolation
and it works with 8g.Robert Jaros
01/23/2025, 2:20 PMOleg Yukhnevich
01/24/2025, 5:17 PMkilua
module - it's just big
Previously Dokka were executed inside Gradle daemon and wasn't able to run in parallel in most cases - and so 6GB (in gradle.properties
) were enough to generate documentation for every module separately
That's why now with ClassloadedIsolation
you are getting OOM with the same or even bigger memory there - because Dokka run in parallel
So yes, for your use-case it's better to use ProcessIsolation
with 8GB because of this big module. You could also set those 8GB only for that kilua
module - may be it will use less memory overall (by default we set 2GB for worker)
Also, just keeping you informed: thanks to your project, I found some places which could optimize Dokka memory consumption 🙂
In any case, thanks for trying DGPv2!Robert Jaros
01/24/2025, 5:37 PM