Jmeter is a powerful load testing tool. If you are new to it you might run into some of the following problems: Out of memory error, it consumes a a lot of memory and CPU or even with a high end pc it can only work with 200 threads at the time.
Here are some tips and tricks about how can you improve the performance of Jmeter.
A simple and an important thing is to always you the latest version of Jmeter. Memory usage and performance is improved with every version so always be up to date.
The biggest error that the beginners do is the usage of listeners. Using a lot of listeners will result in out of memory since report generating takes a lot of resources. The best thing to do is to remove all the listeners. If you are asking how will you know the results then, you can use the “Simple Data Writer” to collect the results and you view the results later and generate the graphs.

If you decide to remove the listeners and go with the data writer, you need to add these lines into the user.properties file:

jmeter.save.saveservice.output_format=csv
jmeter.save.saveservice.data_type=false
jmeter.save.saveservice.label=true
jmeter.save.saveservice.response_code=true
jmeter.save.saveservice.response_data.on_error=false
jmeter.save.saveservice.response_message=false
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.thread_name=true
jmeter.save.saveservice.time=true
jmeter.save.saveservice.subresults=false
jmeter.save.saveservice.assertions=false
jmeter.save.saveservice.latency=true
jmeter.save.saveservice.bytes=true
jmeter.save.saveservice.hostname=true
jmeter.save.saveservice.thread_counts=true
jmeter.save.saveservice.sample_count=true
jmeter.save.saveservice.response_message=false
jmeter.save.saveservice.assertion_results_failure_message=false
jmeter.save.saveservice.timestamp_format=HH:mm:ss
jmeter.save.saveservice.default_delimiter=;
jmeter.save.saveservice.print_field_names=true


When running a load test, there is result data that you might not need. These lines will declare what will be saved. As you can see in the first line the output format is CSV, it has some performance benefits over XML so go with CSV when you can.

Important thing is to configure the Jmeter java options. To do that open the jmeter.bat file with a text editor. Find the –Xmx value and change it to the value that your pc can handle. Xmx specifies the maximum size, in bytes, of the memory allocation pool. By default it is set to 512m. After changing it make sure you also change the MaxNewSize to respect the original ratio between MaxNewSize and Xmx.

Try to not use the Xpath Extractor. It will build the DOM tree and it takes resources (CPU and memory) to do it. If you can use the Regular Expression extractor. But even when using the regular expression extractor try to use efficient expressions.

Jmeter has a non-gui mode. Try to use the GUI mode only for creating the test plan and debugging purposes. Use the non-gui mode for the load test. You can start the test by writing the next line into the OS console:

<JMETER_HOME>/bin/jmeter -t <Path to Test Plan>  -n -l <path to results>/results.csv
  • -n – non gui mode
  • -t – location of the test plan
  • -l – log file to output

These are some tips how to improve the performance, but in the end one pc can’t handle the number of threads anymore you can try the remote (distributed) testing.

Similar Posts from the author: