Skip to content

Conversation

ShreckYe
Copy link
Member

@ShreckYe ShreckYe commented Nov 6, 2024

No description provided.

…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.
@ShreckYe ShreckYe self-assigned this Nov 6, 2024
@ShreckYe
Copy link
Member Author

ShreckYe commented Dec 18, 2024

There seems to be not enough memory for Dokka v2.0.0-Beta. Wait for a new release and see if this is fixed.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 7, 2025

Copilot AI and others added 29 commits September 29, 2025 12:10
…mon project

Co-authored-by: ShreckYe <27768951+ShreckYe@users.noreply.github.com>
Co-authored-by: ShreckYe <27768951+ShreckYe@users.noreply.github.com>
…ction

Co-authored-by: ShreckYe <27768951+ShreckYe@users.noreply.github.com>
…fic details

Co-authored-by: ShreckYe <27768951+ShreckYe@users.noreply.github.com>
…man developers

Co-authored-by: ShreckYe <27768951+ShreckYe@users.noreply.github.com>
Co-authored-by: ShreckYe <27768951+ShreckYe@users.noreply.github.com>
…db-8915-7914dc2c7a25

Add comprehensive .github/copilot-instructions.md for repository onboarding
Co-authored-by: ShreckYe <27768951+ShreckYe@users.noreply.github.com>
…4b-97c5-564fb0c0cb78

Add reference to Kotlin code style guide in copilot-instructions.md
> Execution failed for task ':compose-multiplatform-html-unified-demo:checkDebugAarMetadata'.
It's no longer needed, and it causes the build to fail for the similar Kotlin 2.2.20 reason.
…`applyDefaultHierarchyTemplate`, which was unnoticed and didn't cause much trouble
… which is no longer needed since Dokka 2.1.0-Beta
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants