Skip to content
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

Add API documentation generated with Dokka to the site deployed to GitHub Pages #43

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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
The `mavenLocal()` repository is kept there now since there is CI now.
@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.

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.

1 participant