Cody Wayne Holmes created MNG-6836:
--------------------------------------
Summary: Too Many Open Files for large projects
Key: MNG-6836
URL: https://issues.apache.org/jira/browse/MNG-6836
Project: Maven
Issue Type: Bug
Components: Plugins and Lifecycle
Affects Versions: 3.6.3, 3.6.2, 3.6.1, 3.6.0, 3.5.4, 3.5.3, 3.5.2
Reporter: Cody Wayne Holmes
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|[https://github.com/apache/maven-pmd-plugin/blob/6c1f0a25d5af6a403b4e851c18caf5d084c4a3d9/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java#L796]].
As you can see it calls the method to prepend the classpath for the plugin to
run. This method then
[creates|[https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/PMDConfiguration.java#L196]]
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.
Thanks.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)