When we run junit test, actualy with maven, it use lot of RAM. We have more than 8000 unit tests and it take 30 minutes to finish. Our stack is based on spring and hibernate, unit test are more integration tests because it's used un database (Mariadb) to run. We use also Mockito and Powermokito.
So I'm very surpising by metaspace usage and classes loaded. I need to optimize that, any advice will be welcome.
UPDATE : We split unit test in 2 tests suites, one with powermock and one without powermock, and we fork surfire lauch. So we get that kind of curve only for powermock jvm (uge increase of metaspace memory). So I found an advice to use @PowerMockIgnore, but we already use it. Anyway spliting in 2 tests suites reduce memory usage.