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

Fix large number of open files from java parser #95

Merged

Conversation

SevereOverfl0w
Copy link
Collaborator

There's a file manager that backs each DocletEnvironment. As part of
parsing the docs, a jars from the classpath are loaded into it. If you
do not close the file manager after you're done with the
DocletEnvironment, they're held onto forever.

Especially due to the (future) in orchard.java which parses the docs
for a bunch of classes, this can quickly snowball into the maximum file
limit being reached. It won't fail in the foreground, but further
attempts to open files will fail.

Closing the file manager is recommended in
https://docs.oracle.com/en/java/javase/11/docs/api/java.compiler/javax/tools/JavaCompiler.html

I attempted to reuse a file manager, but it didn't seem to work
correctly between invocations. Presumably because of compiler state or
something.

  • The commits are consistent with our contribution guidelines
  • You've added tests to cover your change(s) (Tricky one to test, probably not worth the effort)
  • All tests are passing
  • The new code is not generating reflection warnings

There's a file manager that backs each DocletEnvironment. As part of
parsing the docs, a jars from the classpath are loaded into it.  If you
do not close the file manager after you're done with the
DocletEnvironment, they're held onto forever.

Especially due to the `(future)` in orchard.java which parses the docs
for a bunch of classes, this can quickly snowball into the maximum file
limit being reached.  It won't fail in the foreground, but further
attempts to open files will fail.

Closing the file manager is recommended in
https://docs.oracle.com/en/java/javase/11/docs/api/java.compiler/javax/tools/JavaCompiler.html

I attempted to reuse a file manager, but it didn't seem to work
correctly between invocations.  Presumably because of compiler state or
something.
@SevereOverfl0w SevereOverfl0w force-pushed the dmonroe/cleanup-file-manager branch from 03b153d to af113e3 Compare June 24, 2020 20:38
@bbatsov bbatsov merged commit 08aa046 into clojure-emacs:master Jun 25, 2020
@bbatsov
Copy link
Member

bbatsov commented Jun 25, 2020

Thanks!

bbatsov added a commit that referenced this pull request Jun 25, 2020
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

Successfully merging this pull request may close these issues.

2 participants