Out of memory (java heap) when running a package with too many test cases

I have a package that references several test classes. A total of 15,354 test cases. When I run the package, I get an error from memory at the 11000th mark (more or less).

I run it on Win 7 64-bit with 4G RAM. I also increased my java heap in eclipse startup configuration to 1536M.

It works fine if I run the test classes separately. Is there a way / or guide that I can follow to reduce the print of my memory?

I previously reorganized the code to use the superclass in my test cases, and use class variables to reduce memory consumption, but now it will no longer cut it.

+4
source share
2 answers

As I know, there is a difference between junit and testng:

  • junit initializes all test cases before starting the first
  • testng initializes the test, which it will actually start.

But I can’t find a diagram showing the running time of the same test written in testng compared to junit.

0
source

You have several ways to tune the memory heap. The easiest option is to use -Xms. You can see the reduction in java memory .

0
source

All Articles