-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.OutOfMemoryError: Java heap space #3885
Comments
Hey! dokka {
dokkaGeneratorIsolation = ClassLoaderIsolation()
} For more information on what it does, you can take a look on updated extensive KDoc. |
Thank you. that resolved the problem. |
Gradle version should also be above 8.10 |
@whyoleg should this be added to the subprojects (the convention plugin), or the root project, or both, if I have a multi-module build? |
You can take a look at my project, maybe it can help you https://github.com/SakurajimaMaii/Android-Vast-Extension/tree/preview/kotlin-2.0.0/libraries |
@SakurajimaMaii OK thanks. |
…adapted from "gradle-common", and resolve heap memory issues A source commit: huanshankeji/gradle-common@c1c69c3 `java.lang.OutOfMemoryError: Java heap space` occurs when running the `dokkaGenerate` Gradle task without further configuration and is resolved with the approach from Kotlin/dokka#3885 (comment). The solution code `dokkaGeneratorIsolation = ClassLoaderIsolation()` has to be added to the subproject build scripts (the convention plugin) to work. Moreover, this happens when the heap space is not enough: ```text The Daemon will expire immediately since the JVM garbage collector is thrashing The project memory settings are likely not configured or are configured to an insufficient value. The memory settings for this project must be adjusted to avoid this failure. These settings can be adjusted by setting 'org.gradle.jvmargs' in 'gradle.properties'. The currently configured max heap space is '2 GiB' and the configured max metaspace is 'unknown'. ``` Therefore, `Xmx` in `org.gradle.jvmargs` is increased all the way to 32 GB. 4 GB and 8 GB still cause GC thrashing, and 16 GB is enough but the task takes more time compared to 32 GB with swap. The actual max memory usage is about 30 GB with the 32 GB max heap size. This seems to be caused by parallelism so to reduce the max memory usage, the `--max-workers` Gradle argument can be used and is tested to work. `--no-parallel` doesn't make a difference as tested, however. Eventually, after the 2 issues above are fixed, the task still fails because of Kotlin/dokka#3900.
Describe the bug
When upgrading Dokka from 1.9.20 to 2.0.0-Beta, executing
dokkaGenerate
task fails:Expected behaviour
Should generate HTML output.
To Reproduce
Please checkout this commit and apply the below dokka configs in
library/build.gradle.kts
and run./gradlew wavy-slider:dokkaGenerate
Dokka configuration
gradle.properties:
org.jetbrains.dokka.experimental.gradle.pluginMode=V2EnabledWithHelpers
library/build.gradle.kts:
Installation
Additional context
Dokka 1.9.20 worked properly.
The text was updated successfully, but these errors were encountered: