Troubleshoot Common Issues While Executing the ScriptsTestRunner.runner.TestRunner>> OutOfMemory Java heap space

TestRunner.runner.TestRunner>> OutOfMemory Java heap space

Increase JVM heap space to resolve OutOfMemory errors that prevent report generation during large-volume test runs.

OutOfMemory Errors

Issue: During test execution, the Java Virtual Machine (JVM) may run out of memory while handling a large volume of data, resulting in reports not being generated. This issue can arise when running a large number of test cases or when the report size increases significantly. The following error message is displayed:

TestRunner.runner.TestRunner >> OutOfMemory Java heap space

Resolution: Increase the JVM heap space allocation to resolve this issue.

Running test cases with Maven

To execute all test cases:

mvn test -DargLine="-Xmx512m"

To execute a specific test case:

mvn test -Dcucumber.filter.tags="@test002" -DargLine="-Xmx512m"

Starting the Apache server

Run the following command to start the Apache server with an increased heap allocation:

java -Xmx512M -jar algoqa_springboot_api.jar

This command allocates 512 MB of heap space to the Java server. You can increase or decrease the heap space according to your requirements.