Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix named instantiator leaking memory
This commit reworks the named object instantiator so that it doesn't leak memory, by locating the cache on the `VisibleURLClassLoader` instance whenever possible. Previously, it retained strong references to classes, meaning that any class loaded via a script classloader would be strongly referenced and would prevent the loader from being collected. With this change, the cache is now located on the loader itself. If, for some reason, the loader is not a known classloader, we will still use a global cache, but this shouldn't leak memory anymore since in this case it's likely the affected classes come from Gradle core itself. Fixes #8142
- Loading branch information
Showing
3 changed files
with
79 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters