How to set the -Xmx for JRE when start running JMeter

4.2k views Asked by At

When running JMeter, java server has the -Xmx value of only 512 MB. I tried to change it via following code in the jmeter.bat.sh file.

set HEAP=-server -Xms512m -Xmx6144m

set NEW=-XX:NewSize=512m -XX:MaxNewSize=6144m

also tried this:

set HEAP= -Xms512m -Xmx6144m

set NEW=-XX:NewSize=512m -XX:MaxNewSize=6144m

By checking the process after while JMeter is running I can see that java -sever doesn't recognize this setting.

1

There are 1 answers

0
Dmitri T On

If you are running jmeter startup script on Linux the syntax will be different, i.e:

HEAP="-Xms512m -Xmx6G"

as SET command is something Windows-specific

Alternatively you can define JVM_ARGS environment variable value like:

JVM_ARGS="-server -Xms512m -Xmx6G" && export JVM_ARGS

this way you won't need to edit files and/or restart JMeter.

Finally, you can launch JMeter jar directly like:

java -server -Xms512m -Xmx6G -jar ApacheJMeter.jar

See the following reference material: