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

Tamás Cservenák commented on SUREFIRE-754:
------------------------------------------

Just to confirm (in practice), this fix does work great!

We had an internal build suffering from this exact problem, and to fix it, I 
"back-ported" this one change and applied it to 2.9 tag of Surefire. It does 
work.

Sources:
https://github.com/cstamas/maven-surefire/tree/oom-fix

Patched surefire available from here (note: version is set as 2.9-SONATYPE to 
clearly mark it's patched nature)
https://repository.sonatype.org/content/repositories/sonatype-apache-releases/

> unbounded memory use when capturing logs
> ----------------------------------------
>
>                 Key: SUREFIRE-754
>                 URL: https://jira.codehaus.org/browse/SUREFIRE-754
>             Project: Maven Surefire
>          Issue Type: Bug
>    Affects Versions: 2.9
>            Reporter: Andrew Gaul
>            Assignee: Kristian Rosenvold
>             Fix For: 2.10
>
>
> Surefire should dump logs directly to a file instead of buffering in-memory.
> Exception in thread "ThreadedStreamConsumer" java.lang.OutOfMemoryError: Java 
> heap space
>         at java.util.Arrays.copyOf(Arrays.java:2894)
>         at 
> java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:117)
>         at 
> java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:407)
>         at java.lang.StringBuffer.append(StringBuffer.java:241)
>         at 
> org.apache.maven.surefire.report.ConsoleOutputFileReporter.writeMessage(ConsoleOutputFileReporter.java:115)
>         at 
> org.apache.maven.surefire.report.MulticastingReporter.writeMessage(MulticastingReporter.java:101)
>         at 
> org.apache.maven.surefire.report.TestSetRunListener.writeTestOutput(TestSetRunListener.java:99)
>         at 
> org.apache.maven.plugin.surefire.booterclient.output.ForkClient.consumeLine(ForkClient.java:132)
>         at 
> org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.run(ThreadedStreamConsumer.java:67)
>         at java.lang.Thread.run(Thread.java:679)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to