I am using JMETER with my Powershell script and my JMX (XML for Jmeter) file is already created and I Launch the JMETER in Non-GUI mode and pass the JMX to it.
But previously it was working but I added some more Thread Groups with multiple HTTP requests now there may be some heap size issue.
So I thought of disabling some thread groups from the command line using my Automation script(Powershell).
How to disable some thread groups in the JMX file through the command line?
Define number of threads (virtual users) for Thread Groups using __P() function like:
${__P(group1threads,)}
- for 1st thread group${__P(group2threads,)}
- for 2nd thread groupetc.
If you want to disable a certain Thread Group - just set "Number of Threads" to 0 via -J
command-line argument like:
jmeter -Jgroup1threads=0 -Jgroup2threads=50 etc
However a better idea would be increasing Heap size as JMeter comes with quite low value (512 Mb) by default which is fine for tests development and debugging, but definitely not enough for the real load test. In order to do it locate the following line in JMeter startup script:
HEAP=-Xms512m -Xmx512m
And update the values to be something like 80% of your total available physical RAM. JMeter restart will be required to pick the new Heap size values up. For more information on JMeter tuning refer to 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure guide.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With