-
Notifications
You must be signed in to change notification settings - Fork 21
memory and jar file handler leak #9682
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
Comments
Imported From: https://issues.scala-lang.org/browse/SI-9682?orig=1 |
@retronym said: Here's a sketch of how we could improve the situation: https://github.com/scala/scala/compare/2.12.x...retronym:ticket/9682?expand=1 The diff gets large as I started applying the same idea to the compilation classpath. That is tricker as we need to propagate the |
Samuel Halliday (fommil) said: |
Samuel Halliday (fommil) said: It would be much better if any use of |
@adriaanm said: |
I have spotted this bug in the context of the presentation compiler but it also affects the compiler: https://github.com/ensime/ensime-server/issues/1322
The compiler's classloader is not releasing references to jars and they get kind of lost. It's actually a well known JVM bug and also affects sbt as I noted here sbt/sbt#2496
The impact is that jar files (which could be targets of the build tool, or scalac itself) on Windows become immutable and cannot be deleted, changed, or moved. This is really very bad. In the best case scenario (Linux), it's just a memory leak.
Some more reading
with the http://www.docjar.com/docs/api/com/sun/tools/javac/file/CloseableURLClassLoader.html being proposed as a workaround (I've not personally used it, but it sounds sensible). I got IllegalArgumentExceptions when I tried to reflectively access the internals of the classloader, so I hope the openjdk class is somehow able to workaround that.
Note that this is independent of #9632 but they have a similar effect. But this one is far more serious as when the classloader is thrown away, the JVM seems to be unable to ever run the finalizers of the JarFiles.
The text was updated successfully, but these errors were encountered: