Skip to content

Memory Leak in regard to TestClassLoader / Metaspace #77

@domdorn

Description

@domdorn

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions