Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-6836

Too Many Open Files for large projects



    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.5.2, 3.5.3, 3.5.4, 3.6.0, 3.6.1, 3.6.2, 3.6.3
    • Fix Version/s: None
    • Component/s: Plugins and Lifecycle
    • Labels:


      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.




          Issue Links



              • Assignee:
                cholmes5324 Cody Wayne Holmes
              • Votes:
                1 Vote for this issue
                6 Start watching this issue


                • Created: