5

In JMeter I am getting this error.

jmeter.JMeter: Uncaught exception:  java.lang.OutOfMemoryError: Java heap space

Please let me know how to resolve.

olyv
  • 3,699
  • 5
  • 37
  • 67
bugCracker
  • 3,656
  • 9
  • 37
  • 58
  • possible duplicate of [JMeter issues when running large number of threads](http://stackoverflow.com/questions/14610801/jmeter-issues-when-running-large-number-of-threads) – olyv Nov 05 '14 at 09:09

2 Answers2

13

Increase the JMeter heap memory

  1. Within your explorer find where you installed JMeter
  2. Open up the bin directory.
  3. Find the JMeter.bat file and open it with a text editor
  4. Find the following set HEAP

    You can set this HEAP value to whatever you like, in this example I've said allocate 2 GB of memory from the start and throughout the test run: set HEAP=-Xms2048m -Xmx2048m

Satpal
  • 132,252
  • 13
  • 159
  • 168
bugCracker
  • 3,656
  • 9
  • 37
  • 58
  • 1
    Note to those who can't just edit their jmeter script file: in *nix systems (and maybe Windows? Not sure), you can call jmeter like this to get the same effect: `JVM_ARGS='-Xms2048m -Xmx2048m' jmeter` – coredumperror Mar 21 '17 at 19:22
  • Fixed the issue i was facing. Thanks! – Manav Sharma Jun 20 '18 at 15:37
  • How much to set the Heap memory size? It there a formula? e.g. am testing a search service on Elasticsearch, initial data is 3.3 million documents for 10K-20K agents. I'm testing the performance of 12,000 requests to the service in 24 hours (approx. 3.3 requests per second) . How much do I need the heap size to be? – Binyamin Regev Feb 23 '20 at 14:12
0

Have you considered adding another load generator? Even if you get to 80% of your pool you are going to have testbed influences on your result set. This, by the way, is tool independent.

Recommended best course is at least three load gens. Two for primary load and one for a control set of a single business process of each type. If all degrade together then you know with high certainty that you have a common issue, app degradation. If your primary degrade but not your control then you have overloaded generators. It's best you catch them rather than using bad data to make a decision on scalability that could result in chasing engineering ghosts in your code.

James Pulley
  • 5,606
  • 1
  • 14
  • 14