mirror of
https://github.com/sbt/sbt.git
synced 2026-09-08 11:13:23 +02:00
I noticed in a heap dump of sbt that there were many classloaders for the scala instance. I then realized that we were making a new classloader for the scala library on every test run. Even worse, the ScalaInstanceLoader instance was never closed which lead to a metaspace leak. I moved the scala instance classloader to the global classloader cache. Not only will these be correctly cached, they will be closed if evicted from the cache.