1 Use JMeter in non-GUI mode
- Find where you installed JMeter through command line or the terminal
- Set the ‘bin’ directory as your current directory
- Run ‘jmeter –n –t <location of script>.jmx
- That’s it, when your test is complete you can do your analysis. You may be interested in seeing how your test is performing during execution in command line/terminal (rather than seeing a black window), to do this just uncomment the following within the JMeter properties file (remove the ‘#’):
#summariser.name=summary
#summariser.interval=180
#summariser.out=true
#summariser.interval=180
#summariser.out=true
2 .Remove or at least disable listeners you don’t need. Typically listeners such as the ‘View Results Tree’ consume large amounts of memory purely down to how much information it gathers.
- Simply take a second look at your script and remove the listeners you don’t need.
3 Increase the JMeter heap memory
- Within your explorer find where you installed JMeter
- Open up the bin directory.
- Find the ‘JMeter.bat’ file and open it with a text editor
- Find the following ‘set HEAP’
- You can set this HEAP value to whatever you like, in this example I’ve said allocate 2 GB of memory from the start and throughout the test run: ‘set HEAP=-Xms2048m -Xmx2048m’
Please note if you increased the allocated JMeter heap memory remember that you need to have Java runtime environment 6 or above. What you may notice is you’re unable to allocate more than 2 GB of memory; this happened to me, JMeter refused to open, and was the cause of the JMeter only being able to use 1 CPU core. A quick fix for this is to install the 64 bit Java runtime environment, this should alleviate the problem.
I hope this helped you, for my testing it did. If you have any questions or just liked this article feel free to leave a reply. If you want more information on best practices with JMeter please take a look at this link: