Monday, May 28, 2012

Jmeter Heap Error!

Hi All!  
        
While using Jmeter, it is not always like you record script, provide number of threads, add listeners and run the script. I am saying this because so many time when we try run our test, we face some error not all the time but some time when we increase the number of threads. This is usually caused by including memory intensive listeners in your stress test. Listeners like "View Tree Results" are useful for debugging your test, but they are too memory intensive to remain in your test when you ramp up the number of simulated users and iterations. The best listeners to use for a long-term, high-load test are Aggregate Listener, Graph Listener, and Spline Listener.
Here is the image of that particular section where you will find the area where you can make changes to reduce the heap error.
To go to this area, Go to the" Jmeter" folder where you have copied that. Then explore this folder and open "jmeter.bat" with notepad, and find the area mentioned in the image:










Now as you can see in the above image, the heap size, new heap size. Now one important thing, is if you want to test your web application with more that 500 users and your system configuration is only 512 MB Ram or your have 1000 users or more that that and you have 2 GB m/c so it is going to little bit tough for you to run your load test.
Because if a m/c with 2GB ram can generate 1000 user max. Rest your application will get choked because of m/c's slowness. 
Heap size is depends upon your system configuration. So if you have 2GB m/c then increase your heap size to 1024-1024m or 512-1024m, according have much free space you have in your m/c.

You can make changes directly from the area mentioned in the image.

And one most important thing, do not put max load at first instance. First check the behavior of your m/c with less number of users.

Enjoy your load test with Jmeter.   :)