The Wayback Machine - https://web.archive.org/web/20201112101449/https://github.com/playframework/playframework/pull/10500
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

Fix classloader memory leak, due to ClassTag #10500

Open
wants to merge 4 commits into
base: master
from

Conversation

@jtjeferreira
Copy link
Contributor

@jtjeferreira jtjeferreira commented Oct 26, 2020

Pull Request Checklist

Helpful things

Fixes

Fixes classloader memory leak, due to ClassTag

Purpose

Launches scripted tests with a limited metaspace size. With this change most of the tests fail. After analyzing the heap dump in yourkit profiler, one can see that ClassTag#cache is not allowing the classloaders created by play to be GCd.

The fix is to separate the classloader that loads ClassTag from the classloaders that load the rest of the application classes (libraries and user code), and then the classloaders can be GCd.

I also opened a PR in scala (scala/scala#9276), but I also managed to fix it in play-plugin. As you can see in that PR discussion this is not a problem in scala 2.13, but the scripted tests only run with scala 2.12

References

#9935
scala/scala#9276

@jtjeferreira jtjeferreira changed the title fight leaks Fix classloader memory leak, due to ClassTag Oct 26, 2020
@mkurz mkurz added this to the 2.8.4 milestone Oct 26, 2020
@ignasi35 ignasi35 modified the milestones: 2.8.4, 2.8.5, 2.8.6 Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.