Assertion failure message: java.lang.OutOfMemoryError: Java heap space

  • 4
    OperationNotAllowed (caused by NullPointerException) – user246 Feb 26 '16 at 12:48

This indicates that JMeter lacks Java Heap space. By default JMeter allocates for itself 512MB which is fine for tests development and debugging but not enough for the load test. I would suggest increasing this setting to ~70% of your total available physical RAM.

Look for the following line:

HEAP=-Xms512m -Xmx512


  • jmeter file - if you're using Linux, Unix or MacOSX
  • jmeter.bat file - if you're using Windows

and increase -Xmx setting accordingly.

You may also need to uncomment and tweak NEW="-XX:NewSize=128m -XX:MaxNewSize=128m" line by the same factor and play with GC settings.

See 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure guide for more detailed explanation of JVM settings and some more JMeter performance tweaks.


I had some times problems with the logs, if you use the view results tree or view results in table options they store all the info in memory and that can create memory problems. To avoid that you can increase the memory as The_Amol said or/and save that info directly in a file with the Data Writer.


You need to increase the memory of java process that you are using for JMeter. It iss normal as JMeter by default has a very low heap allocation. It can be controlled using -Xmx parameter.

There is a line in jmeter.bat for windows or jmeter.sh for non window platform script which recommends launching JMeter as

JVM_ARGS="-Xms512m -Xmx512m" jmeter.sh

You can increase maximum heap size to the extent where you stop receiving these errors. I would suggest you to set it to more than 50% of your available RAM on the system that you are using.

Not the answer you're looking for? Browse other questions tagged or ask your own question.