Getting Memory usage of a server in Jmeter


1. The first step is to add a Thread Group element.

The Thread Group tells JMeter the number of threads you want. Always use 1, since we are using JMeter as a monitor. This is very important for those not familiar with server monitors. As a general rule, using multiple threads for a single server is bad and can create significant stress.

Change the loop count to forever (or some large number) so that enough samples are generated.

2. Add the HTTP Authorization Manager to the Thread Group element (Add –> Config element –> HTTP Authorization Manager). Enter the username and password for your webserver. Important note: the monitor only works with Tomcat5 build 5.0.19 and newer.

1.       leave the base URL blank

2.       enter the username

3.       enter the password

3. Add the HTTP Request to the Thread Group element (Add –> Sampler –> HTTP Request). Then, select the HTTP Request element in the tree and edit the following properties):

1.       Change the Name field to “Server Status”.

2.       Enter the IP address or Hostname

3.       Enter the port number

4.       Set the Path field to “/manager/status” if you’re using Tomcat.

5.       Add a request parameter named “XML” in uppercase. Give it a value of “true” in lowercase.

6.       Check “Use as Monitor” at the bottom of the sampler

4. Add a Constant timer to this thread group (Add –> Timer –> Constant Timer). Enter 5000 milliseconds in the “Thread Delay” box. In general, using intervals shorter than 5 seconds will add stress to your server. Find out what is an acceptable interval before you deploy the monitor in your production environment.

5. Add the Monitor Results Listener by selecting the test plan element (Add –> Listener — > Monitor Results). There are two tabs in the monitor results listener. The first is the “Health”, which displays the status of the last sample the monitor received. The second tab is “Performance”, which shows a historical view of the server’s performance.

6. Run the test and see the result in view listener tree.

The free memory and total memory is in response data for that sample.

Note: If you run out of memory

Negative-effect of Jmeter is they consume a lot of memory. If your JVM is running out of heap memory, you need to edit your Jmeter.bat and increase the heap memory size by editing the following line:

>> HEAP=”-Xms256m -Xmx1024m”

Change the jmeter.bat HEAP=-Xms1024m -Xmx1024m

If you have a system RAM of 2GB then edit jmeter.bat to increase heap memory size “Xms1536m-xmx1536m”.


3 Responses

  1. I have read the article on “run out of memory”. It is quite interesting thing. But in addition to increase the heap size you have to increase “newsize” and also “evacuation size”. I would like to ask that how you are calculating heap size from RAM size.

  2. is it possible to montor windows based systems using JMeter.


  3. Hi,

    i’m very new to Jmeter.
    i followed the above mentioned steps execpt step 2 where i ‘m getting response as blank.
    I ‘m trying monitor results for website, for accessing authorization is not required.

    One more doubt where should be “Tomcat5 build 5.0.19”.

    thanks in advance,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: