Skip to content

Conversation

@dfelliott
Copy link
Contributor

Per the API contract, the StandardJavaFileManager is Closeable and must be closed or file handle leaks will occur.

On a very large multi-module Maven project this was causing tens of thousands of open file handles and a sawtooth-shaped time series graph over open files as the GC finalizer just happened to come around and finalize the dereferenced JarFileSystem objects, causing them to close on their own as a stop-gap. On some machines, a "Too many open files" error was experienced, failing the build.

With this change in place, the number of open files fluctuates gently as each compilation opens the files it needs and closes them as soon as it has completed. That is the expected behavior.

@olamy olamy merged commit 23ee074 into codehaus-plexus:master Aug 23, 2020
tomaswolf added a commit to tomaswolf/plexus-compiler that referenced this pull request Aug 24, 2020
olamy pushed a commit that referenced this pull request Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants