2

We have a JMeter test which stops in between giving the following error message

enter image description here

It runs fine when I run the tests with a load of 100,200 and 300 Users

I found one question jmeter test failed with out of memory error but that didn't help to solve the issue.

Have tried running this on machines with 12 GB RAM and also with a 16 GB RAM.

What could be the possible reason for it to behave so?

also tried to run on non-GUI mode even there the test stops.

Non GUI mode

Praveen Rao Chavan.G
  • 2,772
  • 3
  • 22
  • 33

3 Answers3

2
  1. Don't run your test in GUI mode, as per first line of your terminal output you should be using non-GUI mode for running your tests. GUI mode is for tests development or debugging only.
  2. Make sure to use 64-bit Java JDK or Server JRE, you need to choose Windows x64 option
  3. Increase your JVM Heap size by amending HEAP environment variable like:

    set HEAP=4G && jmeter.bat -n -t test.jmx -l result.jtl
    
  4. Make sure to follow JMeter Best Practices and recommendations from 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure article

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
2

I had to add the following piece of code in jmeter.bat ( Batch file )

set JVM_ARGS=-Xms512m -Xmx8000m

I added this in here

    if not defined HEAP (
    rem See the unix startup file for the rationale of the following parameters,
    rem including some tuning recommendations
    set HEAP=-Xms1g -Xmx1g -XX:MaxMetaspaceSize=8000m 

)
set JVM_ARGS=-Xms512m -Xmx8000m 

then it worked just fine.

Praveen Rao Chavan.G
  • 2,772
  • 3
  • 22
  • 33
0

As Dimitri's answer mentions, don't use the GUI, it should only be used for testing or debugging. But this doesn't seem to be the issue for the OP.

In my case I got the issue 2 different times, with 2 different solutions:

  1. I had been using the GUI for testing for a quiet a while and also had some of its output files opened, which were around a GB in total. Closing the GUI and those files gave me back enough memory to run via command line.

  2. I increased the Heap size to 4GB and got error The paging file is too small for this operation to complete. So I upped the system's page file size and was able to run Jmeter. See this link on how to up the page size of the system.

alamoot
  • 1,966
  • 7
  • 30
  • 50