You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When multiple builds are run in the same Gradle daemon if the rewrite classpath changes we'll create a new RewriteClassLoader, but the old one and all the classes it ever loaded never get garbage collected.
We load JGit within RewriteClassLoader to keep it isolated from the rest of the plugin classpath. But JGit registers a shutdown hook in a static initializer. So that holds a reference to the classloader until the end of the JVM.
This becomes a problem only when you do multiple builds on the same Gradle daemon with different classpaths.
This shutdown hook is registered in a static initializer in org.eclipse.jgit.util.FS:
We can't load this class from the parent classloader because it's shaded into rewrite-core.
To fix this we have to do something like:
Run in a separate process
Fork JGit / use a modified class file for that one class that does not register the shutdown hook
Bytecode hackery
The text was updated successfully, but these errors were encountered:
When multiple builds are run in the same Gradle daemon if the rewrite classpath changes we'll create a new
RewriteClassLoader
, but the old one and all the classes it ever loaded never get garbage collected.We load JGit within RewriteClassLoader to keep it isolated from the rest of the plugin classpath. But JGit registers a shutdown hook in a static initializer. So that holds a reference to the classloader until the end of the JVM.
This becomes a problem only when you do multiple builds on the same Gradle daemon with different classpaths.
This shutdown hook is registered in a static initializer in org.eclipse.jgit.util.FS:
We can't load this class from the parent classloader because it's shaded into rewrite-core.
To fix this we have to do something like:
The text was updated successfully, but these errors were encountered: