I have a test suite having 10000+ test cases, and as all these test cases run under one suite (Regression Suite), my suite getting crashed always due to very high memory consumption, maybe the size of the testNG object is so big that my machine's memory with 16GB ram is always getting consumed. How can I solve this problem, or what maybe I am doing wrong?

  • Have you tried to play with Xmx VM parameter? – Alexey R. Oct 16 '20 at 16:41
  • no not yet, can u please describe how can I do this? – Nikunj Aggarwal Oct 20 '20 at 13:17
  • You need to let your JVM know how much memory of those 16GB it can use. AFAIK by default starting from Java 8 it can use up to 25% if total amount of memory is big enough. To set the concrete values you need to use corresponding keys when start your java process. stackoverflow.com/a/14763095/8343843 – Alexey R. Nov 6 '20 at 10:40
  • What is stacktrace you are getting? – dzieciou Dec 6 '20 at 11:50

Have you tried to implement Parallel execution for such a large testNG file. software testing solutions providing companies always recommend to break the file into bits and then try to execute using multiple threads.

Parallel testing cane be implemented in following ways:

  • Parallel- Single Machine - Multiple Processes
  • Distributed Testing- Multiple Machines - Single Process
  • Parallel Distributed Testing- Multiple Machines - Multiple Processes

Try with this and share your feedback if it works for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.