4
votes

While running my test after some time i got below error like "java.lang.OutOfMemoryError: Java heap space" Could some one please help me how to increase java heap space for jmeter.

2018-08-16 18:57:07,765 ERROR o.a.j.JMeter: Uncaught exception: java.lang.OutOfMemoryError: Java heap space 2018-08-16 18:57:14,745 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-6 2018-08-16 18:57:14,745 ERROR o.a.j.JMeter: Uncaught exception: java.lang.OutOfMemoryError: Java heap space

1

1 Answers

6
votes

For JMeter 4.0 default settings are:

-Xms1g -Xmx1g -X:MaxMetaspaceSize=256m

For Windows you can amend them in 2x times:

set HEAP="-Xms2g -Xmx2g -X:MaxMetaspaceSize=512m" && jmeter.bat

For Linux/Unix/Macosx:

export HEAP="-Xms2g -Xmx2g -X:MaxMetaspaceSize=512m" && ./jmeter.sh

Also make sure you're following JMeter Best Practices and recommendations from the 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure