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

Prevent class loaders from leaking when using ClassValue cache #2175

Merged
merged 3 commits into from
Feb 6, 2023

Conversation

shanshin
Copy link
Contributor

ClassValue can transitively refer to an instance of type java.lang.Class, so this may prevent the loader from being collected during garbage collection.

Using SoftReference over the value should solve this problem.

ClassValue can transitively refer to an instance of type java.lang.Class, so this may prevent the loader from being collected during garbage collection.

Using SoftReference over the value should solve this problem.
@shanshin shanshin merged commit b454f34 into dev Feb 6, 2023
@shanshin shanshin deleted the soft-ref branch February 6, 2023 14:04
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