Interview Questions

JMeter keeps getting "Out of Memory" errors. What can I do?

Apache JMeter FAQ


(Continued from previous question...)

JMeter keeps getting "Out of Memory" errors. What can I do?

This is usually caused by including memory intensive listeners in your stress test. Listeners like "View Tree Results" are useful for debugging your test, but they are too memory intensive to remain in your test when you ramp up the number of simulated users and iterations. The best listeners to use for a long-term, high-load test are Aggregate Listener, Graph Listener, and Spline Listener.

In addition, you can instruct the JVM to use more memory by editing the jmeter/jmeter.bat files for linux/windows. Within these files, find a section that sets values for the Heap:

* set HEAP=-Xms256m -Xmx256m

Feel free to change these values. Xms indicates the starting RAM the jvm will take, and Xmx will be the maximum it is allowed (for the HEAP).

(Continued on next question...)

Other Interview Questions