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

Classes are not unloaded after BCV tasks #281

Open
osipxd opened this issue Nov 20, 2024 · 0 comments
Open

Classes are not unloaded after BCV tasks #281

osipxd opened this issue Nov 20, 2024 · 0 comments
Labels

Comments

@osipxd
Copy link
Member

osipxd commented Nov 20, 2024

After running BCV tasks, Gradle doesn’t free up metaspace memory.
For example, in the Ktor project, each run of apiDump uses up to 4GB of metaspace memory (#281). The only way to free up this memory is to restart Gradle Daemon.

Here is an example of four consecutive launches of ./gradlew apiDump --rerun-tasks in the Ktor project.
image

It is a known Gradle bug:

Steps to reproduce

  1. Clone Ktor repository
    git clone [email protected]:ktorio/ktor.git
  2. Run VisualVM or any other VM monitoring tool
  3. Run ./gradlew apiDump --rerun-tasks several times
  4. Look at metaspace usage by Gradle Daemon process in VisualVM

Possible workaround

Some projects use processIsolation instead of classLoaderIsolation (cortinico/ktfmt-gradle#206, sigstore/sigstore-java#283). Could this solution be used for BCV?

@osipxd osipxd changed the title Classes are not unloaded after BCV task Classes are not unloaded after BCV tasks Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants