1
votes

I have a distributed Jmeter Master-Slave set up. On increasing the throughput to a higher number, I started getting OOM exception for heap space.

OOM Exception

I found this post: How to Increase Heap size to increase the HEAP size in the jmeter.bat file (windows in my case). However for Jmeter slave machines we don't launch jmeter via jmeter.bat but rather via jmeter.server.bat file. I checked this file doesn't have any HEAP memory parameter.

Any suggestions on how to increase the Heap memory size on Slave instances?

2
Thanks Ville for your edits. I will make sure in future I will ask questions with proper formatting. - Vikas

2 Answers

2
votes

Looking into jmeter-server.bat source code:

  1. It respects JVM_ARGS environment variable
  2. It calls jmeter.bat under the hood which in its turn respects HEAP environment variable

So given you're on Windows you can do something like:

set HEAP=-Xms1G -Xmx10G -XX:MaxMetaspaceSize=256M && jmeter-server.bat

and the JVM heap will be increased to 10 gigabytes for the slave instance.


Above instructions are applicable to JMeter 4.0, the behavior might differ on previous versions.

0
votes

The command to start the Jmeter slaves looks like:

nohup java -jar "/bin/ApacheJMeter.jar" "-Djava.rmi.server.hostname=127.0.0.1" -Dserver_port=10000 -s -j jmeter-server.log > /dev/null 2>&1

So if you want to change Java parameters just pass it after java:

nohup java -Xms512m -Xmx512m -XX:+UseCMSInitiatingOccupancyOnly ...