Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jmeter test failed with out of memory error

Tags:

java

jmeter

When try to run jMeter with 50 or more user it gives OutOfMemoryError:

2013/12/18 13:35:15 ERROR - jmeter.threads.JMeterThread: Error processing Assertion  java.lang.OutOfMemoryError: Java heap space
2013/12/18 13:35:15 ERROR - jmeter.threads.JMeterThread: Error processing Assertion     java.lang.OutOfMemoryError: Java heap space
2013/12/18 13:35:15 ERROR - jmeter.threads.JMeterThread: Error processing Assertion  java.lang.OutOfMemoryError: Java heap space
2013/12/18 13:35:15 ERROR - jmeter.threads.JMeterThread: Error processing Assertion  java.lang.OutOfMemoryError: Java heap space
2013/12/18 13:35:16 ERROR - jmeter.threads.JMeterThread: Test failed! java.lang.OutOfMemoryError: Java heap space
2013/12/18 13:35:17 ERROR - jmeter.threads.JMeterThread: Test failed! 

I tried to increase the heap size but still getting the same error.
Even i tried to remove all the listeners but nothing changed.

like image 963
shab Avatar asked Dec 18 '13 00:12

shab


People also ask

How do I fix invalid max heap size?

If you look carefully you will space between -Xmx and 1800M, which is causing "Could not create the Java virtual machine: Invalid maximum heap size -Xmx". syntactically there should not be any space between -Xmx and heap size. Just remove the space between -Xmx and 1400M and it will work.

What is heap memory in JMeter?

bat/sh ). HEAP=-Xms512m –Xmx512m. It means default allocated heap size is minimum 512MB, maximum 512MB. Configure it as per you own machine configuration. It should also be kept in mind that OS also need some amount of memory, so all of the physical RAM shouldn't be allocated.

Does JMeter need JDK or JRE?

1.1. Because JMeter uses only standard Java APIs, please do not file bug reports if your JRE fails to run JMeter because of JRE implementation issues. Although you can use a JRE, it is better to install a JDK as for recording of HTTPS, JMeter needs keytool utility from JDK.


1 Answers

It looks like that you're just lacking Java Heap Space. It's normal as JMeter by default has a very low heap allocation. It's controllable via -Xmx parameter.

There is a line in jmeter.bat or jmeter.sh script which recommends launching JMeter as

JVM_ARGS="-Xms512m -Xmx512m" jmeter.sh

You can try increasing maximum heap until you'll stop receiving these errors. I'd recommend to set it to something like 80% of your hardware RAM.

Also consider JMeter Performance and Tuning Tips article to make sure that you disable memory-consuming listeners, don't overscript, use post-processors efficiently, etc.

like image 61
Dmitri T Avatar answered Sep 18 '22 07:09

Dmitri T