Approximately 20 minutes.
This tutorial covers the following topics:
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:
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.
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.
Please select "Start Console".
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.
In the Start JRA Recording dialog, change the recording time to one minute and start the recording.
5.When the recording is done, the General information about the recording will automatically be shown.
As shown in the screenshot below, click on the GCs tab at the bottom.
The GCs tab can be used to further investigate how the application behaves and if the JVM can effectively do garbage collections.
At the top you see two charts displaying GC information. By grabbing at the ends of the small chart you can focus the range of what is displayed in the larger chart below. That way it is possible to investigate each GC that has taken place. You can click in the chart to display additional information about the GCs and also pause times in the table below.
In this lesson, you learned how to:
In later tutorials we will dive deeper into the usage of JRockit Runtime Analyzer (JRA), JRockit Latency Analyzer and the Memory Leak Detection tool.