Middleware
JRockit
This tutorial will help you get started in using JRockit Mission Control.
Approximately 20 minutes.
This tutorial covers the following topics:
| |
Overview | |
| |
Scenario | |
| |
Prerequisites | |
| |
Installing JRockit Mission Control | |
| |
||
| |
Connecting the Management Console to a running JVM | |
| |
Summary | |
Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: This action loads all screenshots simultaneously, so response time may be slow depending on your Internet connection.)
Note: Alternatively, you can place the cursor over each individual icon in the following steps to load and view only the screenshot associated with that step.
This tutorial covers how to install ans start using JRockit Mission Control.
Since the purpose of JRockit Mission Control is to profile Java applications, we will give you an application to work with. This Java application is well-behaved and it will not have any built-in problems, like leaking memory or prevent effective garbage collection. Those kind of applications will be supplied to you in later deep dive tutorials for the JRockit Mission Control tools.
Before starting this tutorial, you should:
| 1. |
Download the latest release of JRockit Mission Control. You can get it from Oracle JRockit Downloads |
| 2. |
Download the example Java application used in this tutorial. |
You should already have downloaded the installation file for JRockit Mission Control as specified in the prerequisites above.
Depending on your platform, you have either an .exe file or a .bin file. In any case you should be able to execute the file and the instructions below should be valid for both Windows and Linux platforms.
The installation is very straighforward. The only things you need to specify are:
Since JRockit Mission Control is a Java application, it needs to have a JRockit JVM available to run on.
After the installation you will find that you have both JRockit Mission Control and a JRockit JVM installed.
|
1. |
In the first installer screen you get information of which version of JRockit Mission Control you are installing and for which version of Java it is certified. Just click Next.
|
|
2. |
In the second installer screen you specify where you wish to install JRockit Mission Control. As you can see in the screenshot, we choose to install it in a Java folder, where we gather all installations of Java tools, like different versions of JDKs, Ant, etc. But you can install it anywhere you like.
|
| 3. |
In the third installer screen, which you won't see if you install in Linux, you can choose to use the JRockit JVM as the public Java Runtime Environment (JRE) for this computer. This means that whenever a Java program is executed on this machine, it will use JRockit as the JVM. In our installation we are testing so many different versions of JVM's and other Java tools, so we never install the JRE. But you are welcome to do so, if you want to.
|
|
4 . |
Installation is now complete.
|
Starting JRockit Mission Control
Now that you have JRockit Mission Control installed you can start using it.
In windows you can use the Start menu.
In Linux, as well as in Windows, you can run the executable called "jrmc" available in the bin directory of your installation.
Connecting the Management Console to a running JVM
Time to start using JRockit Mission Control.
In this section we will profile the sample Java application that you already should have downloaded as specified in the prerequisites above.
|
1. |
First we need to compile and start the sample Java application. Open a command prompt in the directory where you unpacked the sample application and execute the following commands: $ <path-to-jrmc-installation>\bin\javac GettingStarted.java $ <path-to-jrmc-installation>\bin\java GettingStarted
|
|
2. |
Since this Java application is running on your local machine, JRockit Mission Control will automatically discover it and show it in the JVM browser, as you can see in the screenshot below. If you right-click on the GettingStarted JVM you can select the tool you want to use for profiling.
|
| 3. |
The console has a large number of features accessible through the tabs at the bottom of the screen. But at this point, let's just examine the information that we see in the Overview tab. If you look at the gauge for Used Java Heap, you will notice that it gradually goes up to 80-95 percent before falling back to 40-60 percent from time to time. The same iformation can also be seen in the memory graph in the middle of the screen. The gradually increasing usage of the Java heap is probably due to very frequent garbage collections of "young" objects, while the big fall back from 80-95 percent to 40-60 percent is due to a garbage collect of "old" objects. In the next step, let's do a JRA recording to investigate this further.
|
|
4. |
Please right-click on GettingStarted in the JVM Browser and select Start JRA Recording.
|
|
5. |
When the recording is done, the General information about the recording will automatically be shown.
The GCs tab can be used to further investigate how the application behaves and if the JVM can effectively do garbage collections.
|
In this lesson, you learned how to:
| |
Download, install and start JRockit Mission Control | |
| |
Connect to a running JVM and examine it | |
In later tutorials we will dive deeper into the usage of JRockit Runtime Analyzer (JRA), JRockit Latency Analyzer and the Memory Leak Detection tool.
Place the cursor over this icon to hide all screenshots.