TestNG running out of memory when generating reports?

542 views
Skip to first unread message

charris

unread,
Sep 27, 2012, 9:20:46 PM9/27/12
to testng...@googlegroups.com
Is this just because I have so many TCs?
I added <jvmarg value="-D-Xmx2048m" /> to <testng ...> call, will that be enough? Or should I be splitting tests into multiple suites?

   [testng] ===============================================
   [testng] Regression Tests
   [testng] Total tests run: 27337, Failures: 319, Skips: 52
   [testng] ===============================================
   [testng]
   [testng] Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
   [testng]     at java.util.Arrays.copyOf(Arrays.java:2882)
   [testng]     at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
   [testng]     at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
   [testng]     at java.lang.StringBuffer.append(StringBuffer.java:224)
   [testng]     at java.lang.StringBuffer.append(StringBuffer.java:284)
   [testng]     at java.util.regex.Matcher.appendReplacement(Matcher.java:746)
   [testng]     at java.util.regex.Matcher.replaceAll(Matcher.java:813)
   [testng]     at org.testng.reporters.XMLStringBuffer.toXML(XMLStringBuffer.java:327)
   [testng]     at org.testng.reporters.XMLReporter.generateReport(XMLReporter.java:66)
   [testng]     at org.testng.TestNG.generateReports(TestNG.java:1088)
   [testng]     at org.testng.TestNG.run(TestNG.java:1047)
   [testng]     at org.testng.TestNG.privateMain(TestNG.java:1337)
   [testng]     at org.testng.TestNG.main(TestNG.java:1306)

Cédric Beust ♔

unread,
Sep 27, 2012, 10:06:12 PM9/27/12
to testng...@googlegroups.com
Can you run a profiler (e.g. VisualVM) and see what's eating up all this memory?

-- 
Cédric






--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/jT0z1QnQbqkJ.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

Cédric Beust ♔

unread,
Oct 4, 2012, 2:01:49 AM10/4/12
to testng...@googlegroups.com
Can you launch VisualVM and capture a snapshot of the memory? This should tell us right away what is taking up this memory.

Thanks.

-- 
Cédric




On Wed, Oct 3, 2012 at 7:44 PM, Michael Ondrejko <mjond...@gmail.com> wrote:
I am seeing the same issue. It just started happening, but does not happen consistently. Originally, we had -Xmx1024m when the issue started. I have since raised this to -Xmx2g. However, the exception continues to occur.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/99WI9p2XYNUJ.

Michael Ondrejko

unread,
Oct 5, 2012, 11:20:50 PM10/5/12
to testng...@googlegroups.com, ced...@beust.com
Attached is the heap dump at the time the OOME occurs. Let me know what you think.
Reply all
Reply to author
Forward
0 new messages