[ 
https://jira.codehaus.org/browse/MCHECKSTYLE-207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=341852#comment-341852
 ] 

Dennis Lundberg commented on MCHECKSTYLE-207:
---------------------------------------------

Hi James,

Thanks for the patch. I've had a look at it, and have a question about the 
logged message in the catch clause. When would that happen?
Would it be on Java 7, if and only if the class loader for some reason didn't 
close correctly?

Also, which code is that has a bug in it? The message is a bit confusing to 
me...

> file handle leak - leading to failed builds
> -------------------------------------------
>
>                 Key: MCHECKSTYLE-207
>                 URL: https://jira.codehaus.org/browse/MCHECKSTYLE-207
>             Project: Maven Checkstyle Plugin
>          Issue Type: Bug
>         Environment: Linux
>            Reporter: James Nord
>         Attachments: MCHECKSTYLE-207_PATCH_V1 (1).txt
>
>
> The plugin sets the classpath to load as a URLClassloader populated with all 
> the URLs to the projects dependencies (jars) and output folders.
> However the URLClassloader is never closed (only available in JDK1.7+) and 
> for a large multi-module project with a large number of dependencies this 
> leak can seriously add up (which if gc doesn't kick in at the right moment) 
> will lead to random failures due to java.io.IOException: error=24, Too many 
> open files.
> see 
> http://svn.apache.org/viewvc/maven/plugins/tags/maven-checkstyle-plugin-2.11/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java?revision=1540890&view=markup
> Line 162 where the URLClassloader is created - but never cleaned up.
> The fix is relatively trivial if it is only to be fixed for 1.7+ JVMs (and 
> use reflection if need to be compatable with < 1.7).
> Otherwise a custom classloader will be needed.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to