After submitting ~300 requests through a web service and getting responses back for validation, I am getting 'Java Heap Space' error. Each of these web service responses are about 1 MB in size.
I've narrowed the root cause down to be these large service responses, but how do I work around or resolve this? I have tried the below action items already with no success based on researching this issue:
- Updated to karate 9.6
- Updated to Java 11
- Increased memory size
- Reduced logging (debug to info, etc)
The same thing happens for a different web service where each response is about 50 KB in size, though it took longer for it to run out of memory. It ran out towards the end after 800 orders:
1823874 [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default) on project mvrinteractive: An exception occured while executing the Java class. Java heap space -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default) on project mvrinteractive: An exception occured while executing the Java class. Java heap space