Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.5.2, 3.5.3, 3.5.4, 3.6.0, 3.6.1, 3.6.2, 3.6.3
-
None
Description
This issue seems to be that all plugins classloaders are created and then cached, and plugins are internally creating classloaders that are not being closed and therefore leaving open file handles to jar files waiting to be finalized.
When a project gets big enough with enough modules and plugins than this becomes a problem as the project will reach a large number of open jar files by the time it completes and if the file system is not set up to allow the standard ulimit to be exceeded, then this will cause build failures.
One plugin example that opens and does not close a URLClassloader is the maven-pmd-plugin]. As you can see it calls the method to prepend the classpath for the plugin to run. This method then creates] a URLClassloader that is not closed and must be finalized.
With the deprecation of the finalizer and the knowledge that it is not a good mechanism for closing system resources reliably, this also causes issues for larger projects with a lot of modules and a slightly larger build time.
I am not sure what can be done about this issue in the maven lifecycle, but just wanted to ask the question and find out if anyone else has seen similar issues or knows of a way to resolve this open file handles problem. And possibly find a way to limit the number of open file handles to the downloaded artifacts.
Thanks.
Attachments
Issue Links
- relates to
-
MPMD-297 Classloader not being closed after PMD run
- Closed