JMeter OutOfMemoryError

Viewed 109554

I am facing below OutOfMemor errors, and JMeter stops working....

java.lang.OutOfMemoryError: Java heap space Dumping heap to
    java_pid4412.hprof ... Heap dump file created [591747609 bytes in
    71.244 secs] Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space Exception in thread
    "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError:
    Java heap space Exception in thread "AWT-EventQueue-0"
    java.lang.OutOfMemoryError: Java heap space

How can it be resolved?
My System is having very good specification like 16GB RAM, 2x Quad Core processors, with 146 GB HDD.

Can anyone help me?

11 Answers

How much memory have you allocated for the JVM? Somewhere aroung 512 MB?

The configuration is

java -Xms<initial heap size> -Xmx<maximum heap size>

A lot of these answers are out-of-date. Currently using jmeter v5.1.1 r1855137:

# Set var to increase available memory
JVM_ARGS="-Xms2048m -Xmx4096m"
# Run jmeter via sh script, e.g.:
/jmeter/5.1.1/libexec/bin/jmeter.sh -n -t testfile.jmx -l results.jtl -j log.txt

You can verify that the increase in memory is available via the log.txt file, which will show the following using the values above:

INFO o.a.j.JMeter: Max memory     =3817865216

Run Jmeter in non-GUI mode. Increase the heap size of the memory. Add very less/no listeners. For running Jmeter in non-GUI mode, go to bin directory and open command prompt in that window. use the following command "jmeter.bat -n -t Test.jmx -l Test.csv" here Test.jmx is the test file I need to open in non-GUI mode and Test.csv is the file in which I need my results stored. For increasing size of the memory use the command HEAP="-Xms512m -Xmx2048m" here 512 is the already allocated memory and 2048 is the memory I need to allot to Jmeter.

Hope this helps

Related