[ https://jira.codehaus.org/browse/SUREFIRE-938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=315872#comment-315872 ]
Kristian Rosenvold commented on SUREFIRE-938: --------------------------------------------- This problem has several facets to it; one is that we actually keep stdout/stderr from the process in memory on the plugin side. So technically increasing maven memory through MAVEN_OPTS should get you some way along the line (i.e. export MAVEN_OPTS=-Xmx1024m) The reason "must" keep the output in memory is because we use Xpp3Dom to write the XML reports, which basically keeps it all in memory. So for this issue to be "truly" fixed we'd need to stream the content directly to disk for the xml reports. A second solution could be to simply not buffer in-memory if we don't write xml, which would remove the need for the buffered content. But on the other hand, the stack-trace in question shows that we actually keep the entire output in memory twice, so we can most certainly improve on this situation by only storing it once ;) > out of memory when logging more messages than heap size > ------------------------------------------------------- > > Key: SUREFIRE-938 > URL: https://jira.codehaus.org/browse/SUREFIRE-938 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin > Affects Versions: 2.12.4 > Reporter: Andrew Gaul > > Observed OOM when logging more messages than heap size: > Exception in thread "ThreadedStreamConsumer" java.lang.OutOfMemoryError: Java > heap space > at java.util.Arrays.copyOfRange(Arrays.java:3209) > at java.lang.String.<init>(String.java:215) > at java.lang.StringBuilder.toString(StringBuilder.java:430) > at > org.apache.maven.plugin.surefire.report.TestSetRunListener.getAsString(TestSetRunListener.java:225) > at > org.apache.maven.plugin.surefire.report.TestSetRunListener.wrap(TestSetRunListener.java:230) > at > org.apache.maven.plugin.surefire.report.TestSetRunListener.testSucceeded(TestSetRunListener.java:161) > at > org.apache.maven.plugin.surefire.booterclient.output.ForkClient.consumeLine(ForkClient.java:100) > at > org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.run(ThreadedStreamConsumer.java:67) > at java.lang.Thread.run(Thread.java:662) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira