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

Memory Leak in regard to TestClassLoader / Metaspace #77

Open
domdorn opened this issue Mar 22, 2017 · 1 comment
Open

Memory Leak in regard to TestClassLoader / Metaspace #77

domdorn opened this issue Mar 22, 2017 · 1 comment

Comments

@domdorn
Copy link

domdorn commented Mar 22, 2017

At the moment, https://github.com/sbt/junit-interface/blob/master/src/main/java/com/novocode/junit/JUnitRunner.java#L123 loads all the test classes in the same classloader.
Depending on the amount of tests, this becomes a problem, because class definitions get loaded multiple times, but are not garbage collected.

At my current project, this leads to Out of memory: Metaspace exceptions after a few tests.

I think it would be good if we could create a child classloader for every TestClass which we throw away after the tests ran.

What do you think?

@benmccann
Copy link
Contributor

@domdorn want to create a PR for it? :-)

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

No branches or pull requests

2 participants