You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2004/08/27 00:24:35 UTC

DO NOT REPLY [Bug 30879] New: - OutOfMemoryException at JUnitTestRunner.java:342

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30879>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30879

OutOfMemoryException at JUnitTestRunner.java:342

           Summary: OutOfMemoryException at JUnitTestRunner.java:342
           Product: Ant
           Version: 1.6.2
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Optional Tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: skjones@avaya.com


I'm debugging a junit stress test, and set my logging Level to FINE. My test
starts outputting a TON to the console. The test is running from a forked JVM
using the junit tag's fork attribute="yes" and showoutput="yes".

Using hprof, I tracked it down to JUnitTestRunner's code which stores up all of
the task's stdErr and stdOut in a BYTE ARRAY, and then starts copying it all
over the place using a TeeOutputStream and ResultFormatters. Please update this
class so that it does not hold the task's entire output in memory.

As of today, this problem is present on the HEAD.

HPROF REPORT
SITES BEGIN (ordered by live bytes) Thu Aug 26 15:01:48 2004
          percent         live       alloc'ed  stack class
 rank   self  accum    bytes objs   bytes objs trace name
    1 52.49% 52.49% 32505872    1 65011752   18  1963 [B
    2 41.58% 94.07% 25745080    1 25745096    2 13668 [B

TRACE 1963:
java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:95)
java.io.PrintStream.write(PrintStream.java:258)
org.apache.tools.ant.util.TeeOutputStream.write(TeeOutputStream.java:91)
java.io.PrintStream.write(PrintStream.java:258)

TRACE 13668:
java.io.ByteArrayOutputStream.toByteArray(ByteArrayOutputStream.java:136)
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:342)
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:560)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org