I have problem with Heap Size in jMeter and I need to increase the heap size. I try change in jmeter.bat but in console (when I open gui mode) the displayed info is still default option.
How can I extend the heap size in my jMeter? I need step by step information.
My environment is:
When I check in gui mode in JSR223 Listener with groovy script
java.lang.management.ManagementFactory.getRuntimeMXBean().getInputArguments().each {
log.info("Effective JVM argument: " + "$it")
}
In console I see good value what I create in jmeter.bat.
Can I believe in the groovy script info or what is displayed in the console when I open gui mode?
btw. for test I am using non gui mode, but I was be curious which info is true.
Change your script to use println() function
java.lang.management.ManagementFactory.getRuntimeMXBean().getInputArguments().each {
println("Effective JVM argument: " + "$it")
}
Run your JMeter script in command-line non-GUI mode like
jmeter -n -t test.jmx
You should see default JMeter 5.1.1 heap settings: -Xms1g
and -Xmx1g
Now set HEAP environment variable to increase the lower limit to 5G and the upper limit to 10G
set "HEAP=-Xms5g -Xmx10g"
Re-run your JMeter script - you should see the updated values:
If you want the change to be permanent you need to amend this line of the jmeter.bat
file:
set HEAP=-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m
to contain whatever values you want