'Web Service Responses & Java Heap Space [duplicate]
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
Solution 1:[1]
Please (please) try the 0.9.9.RC3 version. And please create an example along the lines here so we can investigate if needed: https://github.com/intuit/karate/issues/1394#issuecomment-751252092
Hopefully the new / dev version is an improvement. Else we can look at a simulation (you help us with) and figure out an option, e.g. we have to change our code to use streams, or switch off logs.
Also do look at this interesting option: https://stackoverflow.com/a/64352676/143475
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Peter Thomas |
