0

I've recently switched from 2.13 JMeter to 5.1. In 2.13 when java gave out of memory error, I clicked Clear all button and it helped. Now in 5.1 I've got error.

ERROR:o.a.j.JMeter: Uncaught exception: java.lang.OutOfMemoryError: Java heap space

After some runs and some data accumulated in view results tree, but clear button does not help - view results tree becomes empty but error persists and Java mission control shows heap have not been reduced. Could it be some incorrect JMeter config or?

ADDED: Thank you for heap size settings tips. It's for smoke (debug) runs, I know I can increase heap, the question is as stated about clear command behavior and possible difference between versions.

BTW, I've also tried do invoke GC jcmd <pid as reported by task manager in windows> GC.run as per How do you Force Garbage Collection from the Shell? - head was not reduced, which as I understand means JMeter does not release pointers to old java objects.

Alex Martian
  • 3,423
  • 7
  • 36
  • 71

2 Answers2

1

You can increase your heap size in properties file.

# This is the base heap size -- you may increase or decrease it to fit your
# system's memory availability:
HEAP="-Xms512m -Xmx512m"

Refer: https://martijndevrieze.net/2017/01/20/jmeter-tips-tricks-tip-7/

Sugan
  • 447
  • 1
  • 4
  • 16
1

You're violating at least 2 JMeter best practices

  1. You should use command-line non-GUI mode to run your test
  2. You should not be using any listeners

JMeter 5.1 comes with 1 GB heap by default, you can increase JVM heap size by setting HEAP environment variable, for example the following setting will increase the heap to 2 GB:

HEAP=-Xms1024M -Xmx2048M -XX:MaxMetaspaceSize=256M
Dmitri T
  • 159,985
  • 5
  • 83
  • 133