Skip to main content

What is JVM Monitoring

JVM Monitor is an open-source Java profiler that plugs into the Eclipse IDE. It lets you watch the CPU, memory and thread usage of a running Java application without leaving Eclipse.

JVM Monitor screenshot

Why use it?

JVM Monitor is handy when you want a quick look inside a Java application. You don't need to prepare a launch configuration first. It finds the JVMs running on your machine automatically, so you can start monitoring one in a couple of clicks. It can also monitor an application on another machine if you give it the hostname and port.

What it shows

ViewWhat you seeUseful for
TimelineCharts of used heap, loaded classes, thread count and CPU usageSpotting trends during a test run
ThreadsAll threads, including deadlocked ones and threads using a lot of CPUFinding deadlocks and busy threads
MemoryA heap histogram with object count and size per classFinding classes that hold the most memory
CPUA CPU profiler you configure and run, then analyze call by callFinding where CPU time goes
MBeansAttributes you can view and edit, plus operations you can invokeReading or changing settings an application exposes through JMX

Getting started

  1. In Eclipse, go to Help > Eclipse Marketplace, search for "JVM Monitor" and install it. Restart Eclipse when asked.
  2. Go to Window > Open Perspective > Other and choose the Java Monitor perspective. The JVM Explorer lists the Java processes running on your machine.
  3. Right-click the JVM you want and choose Start Monitoring. The Timeline, Threads, Memory and MBeans pages open.
  4. When you finish, right-click the JVM and choose Stop Monitoring.

Monitoring a remote JVM

To monitor an application on another machine, start that application with JMX remote access turned on. For example:

java -Dcom.sun.management.jmxremote.port=9010 \
     -Dcom.sun.management.jmxremote.authenticate=false \
     -Dcom.sun.management.jmxremote.ssl=false \
     -jar your-app.jar

Then, in JVM Explorer, click Add JVM Connection on Remote Host and enter the host and port. If the remote JVM requires a login, enter the credentials too.

Turning off authentication and SSL, as in the example, is only safe on an isolated test network. For anything else, turn both on.

Using it during performance tests

Run your load test while JVM Monitor is attached to the application server. Three things are worth watching:

CPU profiling adds overhead, so don't leave it running during the runs where you record response times.

Before you rely on it

The documentation I found for JVM Monitor 3.8.0 lists support for Eclipse up to Juno (3.8 and 4.2) and Java 6 or 7. Check that it works with your Eclipse and Java versions. If it doesn't, JConsole, VisualVM, and Java Mission Control with Java Flight Recorder offer similar monitoring for current Java versions.

Comments

Post a Comment

Popular Posts

Pacing Time in LoadRunner

What is Pacing? Where and why to use it? -Pacing is the time which will hold/pause the script before it goes to next iteration. i.e Once the   Action   iteration is completed the script will wait for the specific time(pacing time) before it starts the next one. It works between two actions. eg, if we record a script there will be three default actions generated by the Load Runner:   vuser_init, Action   and   vuser_end,   the pacing will work after the   Action   block and hold the script before it goes to repeat it. The default blocks generated by LoadRunner is shown below: Actions marked in Red Now we know what is pacing and we use it between two iteration. The next question comes to mind is why we use pacing: Pacing is used to: To control the number of TPS generated by an user. To control number of hits on a application under test.     Types of Pacing: There are three options to control the pac...

What is Performance Testing and why it is important?

We spend most of our time by browsing Facebook, watching videos, uploading photos and many other online activities. Have you ever noticed if you are watching a video and all of sudden the website goes down? If you are trying to book an online ticket and on the payment page, the website stops responding? If you are adding the last available item on sale in the shopping cart and the website gets hung? Isn't it stressful? For every growing business, it's very crucial to keep a tap on the performance of their application. If a website takes more than 2 seconds to respond then users tend to move to some other website which can cause a huge business loss.  Let's say you are on a retail website and browsing for some item that takes around 2-3 seconds to respond to each click or loading the page. In most cases, the user will go for some other website. Performance Testing gives an idea about how the system is going to behave on load and can help the business owners to ...

What is Pacing and how it's different from the Think Time

What is pacing? Pacing is the wait between two iterations of a script. Once an iteration finishes, the script pauses for a set amount of time (the pacing time) before it starts the next one. When you record a script, LoadRunner generates three default blocks: vuser_init , Action and vuser_end . Pacing takes effect after the Action block, holding the script back before it repeats. The default blocks LoadRunner generates are shown below. Actions marked in red What is think time? Think time copies real user behavior by adding a delay between two actions or transactions, like the pause a person takes before clicking the next link. Can think time replace pacing? In an interview, I was once asked: if you add think time at the end of a script, won't it work as pacing too? If so, why did HP provide two separate settings for the same job? They are not the same, because each has a different purpose. With think time, the thread stays active and LoadRunner waits for the ...