I am testing REST API, each of which returns a 10 MB response body. Now during load test, JMeter gives Out of Memory exception at 20 threads.
Concluded that this is due to APIs have huge response body. When other APIs with fairly low size Response Body are tested I am able to scale up to 500 Threads
Have tried all options shared under hacks to avoid Out of Memory exception:
- Running in Non GUI mode
- All Listeners Off - generating JTL from command line
- Disabled all assertions, relying on application logs
- Groovy used as scripting language in JSR223, using to emulate Pacing between requests
- Heap Size increased to 12 GB
- JMeter 5.4.1 and JDK used
Going for distributed load testing from multiple JMeter host machines also seems to have problem, as when I reduced No. of Threads to 10 for same APIs, Out of Memory Exception still came up.
How to effectively handle huge response body to a request made from JMeter ?