Thursday, 6 August 2009

JMeter memory problems

Sometimes things that have never failed before do fail. Today this happened while using the tried, tested and trusted JMeter load testing tool. I've used JMeter a lot during the years and even though it is starting to show its age, it is hard to find something better to do the job.

Lately the only thing that made JMeter fail was when an OutOfMemoryError occurred. This was always easily solved by adjusting the heap memory size settings (-Xms and -Xmx) and sometimes even the Permanent Generation size settings (-XX:PermSize and -XX:MaxPermSize) to appropriate values. But today we did this to no avail. While we were only running a load test for 40 threads with 10 loops each, it would still crash and burn even with 2 gigabytes of heap memory.

So we were thinking that maybe the listeners were to blame, so we disabled the Graph Results listener and even the View Results Tree listener, but still kept getting OutOfMemoryError occurrences. So now we were kind of stuck, or maybe not... . I remembered that JMeter can also be run remotely and without a GUI. Could this maybe help? It sure can't hurt to try. So we fired up JMeter in non-GUI mode and what do you think, no more OutOfMemoryError occurrences as far as the eye can see (the jmeter.log file in the bin directory that is).

So now we only had to re-enable the listener, configure them to write their data to some files (so that we could view them in JMeter after the non-GUI tests were done) and run JMeter using the following command: ./jmeter -n -t /path/to/loadtest.jmx

No comments:

Post a Comment