Jrockit Mission Control: Oracle Jrockit Runtime Analyzer
Jrockit Mission Control: Oracle Jrockit Runtime Analyzer
Jrockit Mission Control: Oracle Jrockit Runtime Analyzer
Mission
Control TM
Objects Information
Getting Familiar with the Objects Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-1
Viewing Start of Recording Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2
Viewing End of Recording Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3
Threads Information
Turning on the Threads Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-1
Getting Familiar with the Threads Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-2
List of Times when Thread Dump is Taken. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-3
Thread Dump Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-4
The JRockit Runtime Analyzer (JRA) is a Java application and JVM profiler that is especially
designed for the Oracle JRockit JVM. JRA is a well integrated part of Oracle JRockit Mission
Control and measures performance in a non-intrusive way in both production and development
environments.
This section is divided into the following topics:
The recording is a great way to share how the JRockit JVM has worked with your application.
You can also use several recordings to compare and contrast how different command line options
change the behavior of your application, for example, by creating before-and-after recordings.
When sending trouble reports to the JRockit support team, you are required to attach a JRA
recording to your trouble report. The recording is analyzed “offline” by the JRA.
The recording engine uses several sources of information including the JRockit JVM hot spot
detector (also used by the optimization engine to decide what methods to optimize), the operating
system, the JRockit JVM memory system (most notably the garbage collector), the JRockit JVM
thread analyzer (if enabled), and the JRockit JVM lock profiler (if enabled).
As for memory management, there is a graph of the varying heap usage and pause times for the
garbage collections. Detailed information about each GC shows exactly how much memory was
released in a collection. There are also pie charts showing the distributions in size of free memory
blocks and the distribution of occupied memory in small and large object chunks.
This section is a workflow description of how to use the JRA system to find problems and
improvement areas with your Java application and the Oracle JRockit JVM. JRA is excellent to
use when tuning your system, for example when looking for performance bottlenecks, such as
latencies. The typical workflow when working with JRA is described in Figure 2-1.
Figure 2-1 Typical workflow for comparing different JRockit JVM and Java application settings
The first steps are to start the JRockit Mission Control Client and then start you application so
that you can start a JRA recording. The JRA recording takes a snapshot of the system’s runtime
behavior during the time period that you specify, typically a few minutes. As soon as the
recording is complete, it opens in JRA where it can be analyzed “offline”. If you want to, you can
perform changes to your application or change command-line options for the JRockit JVM and
create a new recording. This way, you have a chance to compare and contrast how different
settings affect your application.
The steps for creating and comparing and contrasting a JRA recording are detailed in the
following topics:
1. Start the JRockit Mission Control Client
2. Start Your Java Application
3. Create JRA Recording
4. View Your JRA Recording in JRA
5. Perform Changes in Application or Use Other Command-line Options for the JRockit
JVM
6. Create a New JRA Recording
7. Compare and Contrast Two Recordings in JRA
default. If you do not wish to set up certificates ssl and authentication can be disabled
by providing ssl=false and authenticate=false. Also, if you want to use the
remote discovery feature of the JRockit JVM, you can enable it by setting
autodiscovery=true, for example,
-Xmanagement:ssl=false,authenticate=false,autodiscovery=true
2. Start your Java application and make sure it is running with a load. This way you get the best
possible data collected for the JRA recording.
2. In the JVM Browser, select the JRockit JVM instance you just started or select an entire
folder with running the JRockit JVM instances.
5. From the Select recording file drop-down list, choose JRA Recording Normal.
This option is the “classic” JRA recording. This file contains all information that you as a
returning user have found in JRA recordings for previous versions of JRockit Mission
Control and the JRockit JVM.
6. If you are using the JRockit Mission Control Client as an Eclipse plug-in and you want to use
a different filename for the recording file or save it to a different project, click Browse.
The Browse for Project dialog box appears (Figure 2-3).
Note: If you are using a standalone version of the JRockit Mission Control Client or you
don’t want to change the recording filename or project, skip this step and proceed to
step 10.
7. Select the project and folder wherein you want to save the recording.
9. Click Finish.
The dialog box closes.
10. Set a recording time for the duration of the recording in the Recording time field.
11. Select the time unit you wish to use for specifying the recording time (minutes or seconds).
Note: If you set a time that is too short, e.g. shorter than 30 seconds, you will probably not
get enough sample data for the recording to be meaningful.
2. In the JVM Browser, select the JRockit JVM instance you just started or select an entire
folder with running the JVM instances (if you select a folder, you need to select the JVM you
want to monitor within the JRA Recording dialog box).
4. From the Select recording file drop-down list, choose JRA Recording Normal.
6. If you are using the JRockit Mission Control Client as an Eclipse plug-in and you want to use
a different filename for the recording file or save it to a different project, click Browse.
The Browse for Project dialog box appears (Figure 2-3).
Note: If you are using a standalone version of the JRockit Mission Control Client or you
don’t want to change the recording filename or project, skip this step and proceed to
step 10.
7. Select the project and folder wherein you want to save the recording.
9. Click Finish.
The dialog box closes.
10. Set a recording time for the duration of the recording in the Recording time field.
11. Select the time unit you wish to use for specifying the recording time (minutes or seconds).
Note: If you set a time that is too short, e.g. shorter than 30 seconds, you will probably not
get enough sample data for the recording to be meaningful.
12. Set a delay for when the recording should start in Delay before starting recording.
It is good to set a delay if you know that your application has, for example, a long
warm-up period.
– Thread dumps—creates thread dump data in the beginning and end of recording. If
you set the Thread dump interval, you will also get thread dump data during the
recording.
– Thread dump interval—the time interval for how often thread dumps should be
created. The thread dumps are displayed on the Threads tab in JRA.
– Enable Latency Recording—creates latency data, see Creating a JRA Recording with
Latency Data for more information.
– Latency threshold—sets latency threshold, see Creating a JRA Recording with
Latency Data for more information.
– Enable CPU sampling—records JVM system and user load data and CPU usage. The
information that is recorded is visible on the latency tabs.
– CPU sample interval—sets the time interval for how often CPU sampling should be
performed.
See Also
There are alternate ways to start a JRA recording, see Starting a Recording with jrcmd and
Starting a Recording From the Command Line.
back to the JRockit Mission Control Client, it is saved to the disk where the JRockit JVM is
running and you need to open the file manually by using File > Open.
This topic describes two ways to open a JRA recording: It shows you how:
2. Drag and drop the file into the JRockit Mission Control Client.
3. Click OK.
The JRA General tab now opens and you can view the data in the recording (see
Figure 6-1).
Note: If you have opened a recording that has been recorded with an older version of JRA, some
fields might not have any relevant data, since that data was impossible to obtain. That
data will appear as “N/A”.
2. Open both recordings and lay them out in JRA next to each other (Figure 2-5).
Figure 2-5 shows the difference in Java heap content between two JRA recordings. The
upper recording has much more dark matter than the lower one. The dark matter can cause
disk fragmentation and will eventually slow down your application.
The default behavior is to start the JRA recording from within the JRockit Mission Control Client
(see 3. Create JRA Recording), but there are two alternate ways to start a recording. This section
describes the two alternative ways to start a JRA recording.
Unix platforms:
bin/jrcmd <pid> jrarecording time=<jrarecording time> filename=<filename>
recordingtime Duration, in seconds, for the recording. This is an optional parameter. If you
don’t use it, the default is 60 seconds.
filename The name of recording file. This is an optional parameter. If you don’t use it,
the default is jrarecording.xml.
sampletime The time, in milliseconds, between samples. Do not use this parameter unless
you are familiar with how it works. This is an optional parameter.
nativesamples Displays method samples in native code; that is, you will see the names of
functions written in C-code. This is an optional parameter.
methodtraces You can set this to false to disable the stack trace collection that otherwise
happens for each sample. The default value is true.
Note: Setting methodtraces to false can still result in some stack traces being captured. These
stack traces are captured as part of the JRockit JVM’s dynamic optimizations and will
have a depth of 3. If optimizations are turned off (-Xnoopt) these traces will not be
captured.
The startup options that you have used are shown in the VM Arguments tab on the General tab.
See View VM Arguments.
Listing 3-1 shows an example of how you can setup a JRA recording.
-XXjra:delay=10,recordingtime=100,filename=jrarecording2.xml
z Objects Information
z Threads Information
A JRA recording comes with a wealth of information that might seem cumbersome to interpret
at first. You need to keep in mind, however, that the recording should be used when you know
that you have a problem with your application, then the JRA information can help you visualize
those problems so that you have a better chance of fixing them.
This topic gives an overview of the JRA components and how to customize the tool itself. It
includes the following sections:
z Starting JRA
z JRA Overview
Starting JRA
There are two ways JRA is started: either automatically when you have created a recording (see
To use the normal recording profile) or when you open an already existing recording (see To open
a JRA recording within the JRockit Mission Control Client).
Note: If you are running a JRockit JVM based on Java 1.4, the JRA tool does not open
automatically when the recording is completed.
JRA Overview
JRA is a multi-tabbed interface, each tab allowing you to monitor different aspects of a JRA
recording. New for Oracle JRockit Mission Control 3.0, is that you can view thread information
and thread latency information. When all types of recording data has been collected and when all
tabs are activated, the JRA tool includes eleven tabs within the main window (Figure 5-1). When
you view Latency information, the extra tabs (outside the main JRA window) Event Types and
Properties are also used (marked 2 in Figure 5-1).
Note: The number of tabs that are displayed depends on the JRA recording itself (if all sample
data has been collected or not) and settings in the Properties window (see Turning on/off
Tabs).
1. The main JRA window—the available tabs depends on settings in the Preferences window
and the type of data collected in the JRA recording.
z Filtering Information
3. Set the Min. width and Weight of the column (optional) to a pixel value of your choice.
4. Select Initial sort order for a table item that you want the table to be sorted by.
5. Click OK.
Filtering Information
Some of the information tables can contain lengths of data that can be hard to scroll through.
Instead of scrolling through the long tables, you can filter for the information that you are
interested in viewing.
To filter information
1. Select a table column name for which you want to filter the information. In this example,
Figure 5-5, Pause Time was selected.
2. Enter a number or text for the information you want to see. In this example, Figure 5-5, 60*
was used to see all Pause Times that contains a value starting with 60.
To collapse/expand a view
z Click on the small arrow next to a description field (see highlight in Figure 5-6) to collapse
the view of the General Information field.
Changing to view less values by right clicking a field. The next time you start JRA, you will not
see the specific field.
The JRA recording contains a lot of data about the application’s behavior, information about the
Oracle JRockit JVM itself, such as the version and which commands were used at the startup of
the JVM. That general information is displayed on the General tab in JRA.
For recordings that have been generated with a JRockit JVM that is older than R26.4, you should
still be able to open them in this version of JRA; however, some fields may be blank, since older
versions of the JRockit JVM did not have the same recording capabilities as newer releases.
Note: Only text fields that require extra explanations have been covered in this documentation.
This section is divided into the following topics:
1. General Information—contains all general information about the JVM, operating system,
recording time, etc.
2. Memory Usage—contains information on how the JRockit JVM is using the memory.
z The value Actual recording time can differ from expected recording time, e.g. if the
application running on the JRockit JVM finished while a recording was still in progress.
z The Maximum heap size is set with a JRockit JVM command-line option.
z The VM information can be information regarding the garbage collection that has been
used.
z The value Number of codeblocks is a JVM internal value. All generated code is divided
into (non-heap) memory blocks called code blocks.
z The value Committed java heap was the current total heap size at the beginning and the
end of the recording. It is less than or equal to the maximum heap size.
z View VM Arguments
View VM Arguments
This panel displays (Figure 6-4) the different command-line options that were used when starting
the JRockit JVM. The options that have been used in the example are the following:
z The JRA recording records latencies (XXjra:latency) has been set (100 seconds).
z The name of the recorded file has been set (filename) and the duration of the recording
(recordingtime).
z The initial, minimum and maximum Java heap has been set (-Xms and -Xmx)
z Some non-standard (Oracle internal) D-options have also been set in this example.
There are many more command-line options that can be set. For comprehensive information on
the different command-line options, please see the Oracle JRockit JVM Command-Line
Reference.
You can determine which options you can see by specifying a filter. To filter options, do the
following
1. Select a table column name for which you want to filter the information. In Figure 6-6, the
Key column was selected.
2. Enter text for the information you want to see; for example, in Figure 6-6, cpu* was entered
to limit the options displayed to just those beginning with the text string “cpu”.
z Preferred thread local area (TLA) size is the value that you have set with the
command-line option -XXtlasize:preferred <size>.
z Minimum thread local area size is the value that you have set with the command-line
option -XXtlasize:min <size>.
z Ratio of bytes for large/small objects. Per default, the JRockit JVM considers an object
to be large if it is larger than the thread local area size; it is small if it would normally fit in
a thread local area. Large objects are always allocated in the old space (second generation)
of the heap, never in the nursery.
z The Number (#) free list misses is a JRockit JVM internal value. The JRockit JVM has a
list of free memory blocks on the Java heap. During allocation, an object is normally put in
the first free block on the “free list.” If it does not fit there, the JVM will try the next
block, and the next, etc. Each block where the code block did not fit is considered a “free
list miss.”
z The value of Total number of threads before/after recording shows how many threads
were active before the recording started and how many were active when the recording
ended.
z The value Number of threads started during recording shows how many threads were
started.
z The value System total of # (number) context switches per second is fetched from the
operating system. An unusually high context switch value compared to other applications
may indicate contention in your application.
Methods where the Oracle JRockit JVM spends most of its time are called hot. Once you have
identified such a method, you might want to investigate it to see if it is a “bottleneck” for the
application or not. The way that the JRockit JVM collects method information is via a sampling
thread that is called the hotspot detector. It uses statistical sampling to find Java methods that are
candidates for optimization. The samples are collected by iterating through the Java threads in the
virtual machine and suspending them one at a time. The current instruction pointer of the
suspended thread is used to lookup in which Java method the thread is currently executing. The
invocation count of the method is incremented and the method is added to a queue of methods to
be optimized if the invocation count exceeds a certain threshold.
The JRA recording system makes use of the hotspot detector by setting it to a high sampling
frequency during the recording and directing the samples to the .jra file.
This section is divided into the following topics:
1. Top Hot Methods—a listing of the top hot methods. Click on the different table headings to
get a different sort order.
3. Predecessors—a listing of all preceding methods to the method that you have selected in the
Top Hot Methods list. If you have selected many methods, there will not be any information
shown in this panel.
4. Successors—a listing of all succeeding methods to the method that you have selected in the
Top Hot Methods list. If you have selected many methods, there will not be any information
shown in this panel.
Note: If your recording has native sampling enabled during the recording, you can see methods
prefixed by jvm, which are native methods in the JRockit JVM.
Use the filtering function to find the method you are looking for, see Filtering Information.
The number within brackets of a particular predecessor or successor is the number of sampled
call traces of which the method is part. The percentage shows how common a particular path is
in the method tree. If you see methods that are called a lot from the JRockit JVM, you might want
to investigate if that method is causing your application to run slower than necessary.
The GC General tab shows an overview of information about all garbage collections (GC) that
took place during the recording. The information includes, amongst other, the total number of
pause times and when and how the garbage collector has changed strategy.
This section is divided into the following topics:
1. General—this panel shows overall statistics about the garbage collections during the entire
JRA recording.
2. Garbage Collection Call Tree—this panel is a collection of all call traces that were sampled
for all garbage collections for the JRA recording.
3. GC Strategy Changes—this table lists when a garbage collection strategy took place and
how it changed.
garbage collection. You can use this information to, for example, see whether your application is
coming down to desired pause time averages or not.
Note: These strategy changes only happen if you are running the JRockit JVM with the default
garbage collector option, -Xgcprio.
In the example seen in Figure 8-4, there has been one strategy change for the garbage collector.
Use the filtering function to find a specific garbage collection, see Filtering Information.
The GCs tab shows detailed information about each garbage collection (GC) event that has
occurred. The tab contains a graph for Java heap usage before and after each garbage collection
as well as detailed garbage collection information for each collection.
This section is divided into the following topics:
1. GCs Overview timeline—this timeline shows the entire recording in its full length (when you
initially open your recording). You can use this to refocus the Heap Usage graph, see
Changing Focus on GC Chart.
2. Heap Usage graph—this graph shows heap usage compared to pause times and how that
varies during the recording. If you have selected a specific area in the GC Chart, you will only
see that section of the recording. You can change the graph content in the Heap Usage
drop-down list (marked 6 in Figure 9-1) to get a graphical view of the references and
finalizers after each old collection.
3. Garbage Collections events—this list shows all garbage collection events that have taken
place during the recording. When you click on a specific event, you will see a corresponding
flag in the Heap Usage graph for that particular event, see Viewing Specifics about Garbage
Collections.
4. Details—this panel contains all the details about the specific garbage collection round. When
you select a garbage collection in the Garbage Collection list, the tabs in the Details panel
changes depending on if you have selected an old collection or a young collection.
5. Chart Configuration—this section allows you to change the appearance on the active chart.
6. Drop-down list and Show strategy changes—the drop-down list allows you to select one of
these views on the Heap Usage chart:
– Heap Usage
– References and finalizers
– Pause Time
– CPU
If you select Show strategy changes, you will see when the JRockit JVM has changed
garbage collection strategy.
7. Move and Zoom buttons—these buttons are used with the GCs Timeline.
2. Click either of the Move buttons to slide the focus on the GC Chart.
3. Click the Zoom in or Zoom out buttons (marked 2 in Figure 9-4) to decrease or increase the
visible span of the GC Chart.
garbage collection in the young space (nursery). For more information on garbage collections,
please see Garbage Collection in Oracle JRockit in the Oracle JRockit JVM Diagnostics Guide.
This section is divided into the following topics:
2. Click and hold either the Shift key or Ctrl key to select multiple collections.
The garbage collection index numbers are now visible in the GC Chart (Figure 9-6).
Note: The garbage collection event that was last selected is the one that is displayed in the
Details panel.
Figure 9-7 Tab differences when viewing old and young collections
Each one of these tabs are described here. As much of the information in the tabs are fairly
self-explanatory, those types of details will not be covered in the documentation.
This section describes the following tabs:
z Sum of Pauses—the sum of all pause times in milliseconds that the garbage collector stops
all threads in the JRockit JVM. This is not the same as end time-start time in the case of a
concurrent garbage collector.
z Start/End Time—the times when the garbage collection started and ended, counted in
milliseconds from when the JRockit JVM started.
z Heap Usage Before/After—the used heap size before or after the garbage collection.
z Committed Heap Size—the total size of the heap (used plus unused memory) after the
garbage collection.
z Size of Promoted Objects (and number of Promoted Objects)—the size (and the amount)
of the objects that have been promoted to the old space.
z Nursery Size Before/After—indicates the free space in the nursery before and the free
space in the nursery after the garbage collection (in some cases the nursery size increases).
The information below is only valid for old collections:
z Nursery Start/End Position—the starting and ending position in the memory address of
nursery.
z Mark/Sweep Phase Time—the time spent in the marking and sweep phases, measured in
milliseconds.
z Compacted Size—the size of the heap that has been compacted in the garbage collection.
z Compaction Ratio—the ratio of heap size before and after the compaction, measured in
percent.
z Desired/Actual evacuation—the desired evacuation is the size of the area on the Java
heap that you want to evacuate and the actual evacuation is the size of the area that the
JRockit JVM managed to evacuate. The value for actual evacuation can be smaller than the
desired due to temporarily pinned objects (objects that are not allowed to be moved during
garbage collection). The evacuation takes place during compaction or shrinking of the Java
heap.
z Avg free block size—the average size of each free memory block in the cache list.
z Low limit—the lower limit of a free memory block. There will be no smaller memory
block than this in the selected cache list.
z High limit—the upper limit of a free memory block. There will be no larger memory
blocks than this in the selected cache list.
z GC Pause—this column displays the names of the pauses (the main entry in the tree
structure). If you are running a parallel garbage collector, then there will only be one pause
per garbage collection. For the concurrent garbage collector, there can be several pauses
during one garbage collection. The pauses consists of pause parts that can help the JRockit
engineering staff to analyze why certain pauses are longer than others.
Note: During a pause, the application is standing still.
z Start/End—this is the start and end time, measured in milliseconds. You can change how
the time is displayed by right-clicking in the table and select Start and then the value for
the time.
directly to that method’s source, where you can evaluate the code to see what might be causing
the problem. This feature extremely is useful in helping you locate and debug coding errors that
are creating runtime problems for your application.
The Heap tab gives a quick overview of what the memory in the Java heap consists of in you
application. The overview displays how the heap looked at the end of the recording and it also
shows compiled information about the status of the heap during the entire recording.
This section contains the following topics:
1. Heap Snapshot at the End of the Recording—this panel contains all the specifics about
your heap at a glance.
2. Heap Contents—this graph gives a visual overview of the distribution of different sizes of
objects. The table below the graph gives the exact data for each category of memory.
3. Free Memory Contribution—this graph gives a visual overview of the distribution of the
different chunks of free memory that there is on the heap. The table below the graph gives the
exact data for each category of memory.
The memory that is considered large object chunks, is the total amount of memory on the heap
that the Java application is allowed to use for large objects (64 KB to 512 kB).
The memory for the pinned object chunks is the amount of memory that is occupied by pinned
objects. A pinned object is both referenced by another object in the application and is not allowed
to be moved for compaction purposes, for example, i/o buffers that are accessed from native
methods (native i/o). The number of pinned object chunks shows a value of how many object
that are pinned.
Dark matter is memory that is free, but cannot be used due to the physical layout of the memory
chunk (i.e. it might be too small for the application to allocate). Dark matter can cause
fragmentation on the disk.
The block sizes are categorized by the following entities: small, medium, large, and very large.
The block sizes are multiples of the minimum block size set at startup (default 2kB). You set the
minimum block size with the option -XXminblocksize.
Below are the multiples used for the different block sizes:
z Small: 1–4
z Medium: 4–32
z Large: 32–256
Objects Information
The Objects tab displays the most common types and classes occupying the Java heap at the
beginning and at the end of the JRA recording.
This section is divided into the following topics:
1. Start of Recording—this table lists the most common types on the heap at the beginning of
the recording.
3. End of Recording—this table lists the most common types on the heap at the end of the
recording.
The Oracle JRockit JVM continuously looks for ways to optimize code. The Optimizations tab
displays the methods that were optimized by the adaptive optimization system in the JRockit
JVM during the recording.
This section is divided into the following topics:
1. Optimization—this panel displays the before and after scenario of the optimizations that
have taken place.
2. Methods Optimized During Recording—this table lists which methods that have been
optimized during the recording, i.e. this is necessarily not a full list of all optimizations that
are performed for your application.
The Locks tab shows comprehensive information about lock activity for the application JRA is
monitoring (Java locks) and the Oracle JRockit JVM itself (native locks). You need to enable the
lock profiling data recording capability before you start the profiling of your application. If you
have not enabled the lock profiling data recording, the lock profiling tables are blank on the
Locks tab. For more information on locks, please refer to About Thin, Fat, Recursive, and
Contended Locks in Oracle JRockit.
This section is divided into the following topics:
If you find high contention on a JRockit JVM internal lock that might be causing issues for your
application. Either contact Oracle support or contact the JRockit support team through the Oracle
JRockit Newsgroup at the dev2dev web site.
to that class’s source, where you can evaluate the code to see what might be causing the problem.
This feature extremely is useful in helping you locate and debug coding errors that are creating
runtime problems for your application.
The Processes tab lists which processes were running during the start and the end of the JRA
recording. The information found on this tab is mostly geared towards engineers within the
customer support team, which uses the information to get a picture of which applications that
were running on the machine when, for example, a crash has occurred. This tab is not visible by
default, so you need to turn it on before you can view that information.
This section is divided into the following topics:
3. Select the Enable extra information for JRPG CCE option (Figure 14-1).
4. Click Apply.
5. Click OK.
If you have a JRA recording open when you change this preference, you need to close it
and then open it again for the Processes tab to become visible.
1. Snapshot of the processes running on the machine at the start and at the end of the
recording—this table lists all processes that were active either during the start or the end of
the recording or both.
Threads Information
The Threads tab lists all thread dumps that have been taken during the recording. If no Thread
Dump interval (in the recording options) is specified, the recording will contain a thread dump
from the start and the end of the recording. A thread dump reveals information about an
application’s thread activity that can help you diagnose problems and better optimize application
and JVM performance; for example, thread dumps automatically show the occurrence of a
deadlock. Deadlocks bring some or all of an application to a complete halt.
The information found on this tab is mostly geared towards engineers within the customer support
team. This tab is not visible by default, so you need to turn it on before you can view that
information.
Note: For comprehensive information on how create and use a thread dump, please see the
Using Thread Dumps section in the Oracle JRockit JVM Diagnostics Guide.
This section is divided into the following topics:
3. Select the Enable extra information for JRPG CCE option (Figure 15-1).
4. Click Apply.
5. Click OK.
If you have a JRA recording open when you change this preference, you need to close it
and then open it again for the Threads tab to become visible.
1. Thread dumps taken at various times during the recording—this table lists the times
when a thread dump has been taken.
3. Thread dump—this panel displays the actual content of the selected thread dump.
Finding performance bottlenecks within your Java application is a bit of a detective’s work. You
know what the symptoms of the problem are, for example, the application is running really slow
but the CPU isn’t saturated. Where to start looking for clues to such an issue is tricky since most
profiling tools for Java applications only pinpoint where in the code your application is spending
the most time to run (which is a good start). What these tools tend to miss, however, or not show
at all is where in the application stops and waits occur, i.e. where the application spends time
being idle.
These stops and waits can be caused by poor memory management, such as limited heap space
or a poorly managed heap that requires too many garbage collections. On the other hand the stops
and waits can be latencies caused by multi-threaded applications that spend much of the processor
time waiting, blocking, or sleeping. These problems have previously been hard to detect but now
the JRA system is able to record latencies within your application and visualize running threads
with their events in an easy to understand manner.
This section of the help gives you an overview of how you can use the latency tabs in JRA to work
you way down to a Java application latency. In addition, you get one example of how a Java
application that contains latencies looks on the Latency Graph tab and you will get an example
workflow of how to use all latency tabs together. All in all, you now have a greater possibility to
pinpoint where in the code waits and other latencies occur with the JRA latency capabilities.
This section is divided into the following topics:
z Example of How to Compare two JRA Recordings where one Contains Latencies
2. In the JVM Browser, select the JRockit JVM instance you just started or select an entire
folder with running JVM instances.
6. From the Select recording file drop-down list, choose Latency Recording Normal.
7. Type a descriptive name for the recording in the Local filename field.
The file is created in the current directory of the JRockit JVM process, unless you specify
a different path. If an old file already exists, it will be overwritten by the new recording.
8. Set a recording time for the duration of the recording in the Recording time field.
9. Select the time unit you wish to use for specifying the recording time (minutes or seconds).
Note: If you set a time that is too short, e.g. shorter than 30 seconds, you will probably not
get enough sample data for the recording to be meaningful.
10. Set a threshold value for Latency threshold. The latency threshold is the duration of the
latency itself. As soon as the latency is longer than that threshold, the data will be saved.
For advance option information, see To use the normal recording profile with advanced
options.
2. In the JVM Browser, select the JRockit JVM instance you just started or select an entire
folder with running JVM instances.
5. From the Select recording file drop-down list, choose Latency Recording Minimal
Overhead.
Minimal overhead means that the capturing of latency data affects the system in the least
possible way, i.e. it will not disturb or put extra load when recording.
6. Type a descriptive name for the recording in the Local filename field.
The file is created in the current directory of the JRockit JVM process, unless you specify
a different path. If an old file already exists, it will be overwritten by the new recording.
7. Set a recording time for the duration of the recording in the Recording time field.
8. Select the time unit you wish to use for specifying the recording time (minutes or seconds).
Note: If you set a time that is too short, e.g. shorter than 30 seconds, you will probably not
get enough sample data for the recording to be meaningful.
9. Set a threshold value for Latency threshold. The latency threshold is the duration of the
latency itself. As soon as the latency is longer than that threshold, the data will be saved.
For advance option information, see To use the normal recording profile with advanced
options.
2. Select Remember my selection if you do not want this window to open the next time you
click on a latency tab.
3. Click Yes.
2. Click the zoom in/out buttons to shorten the time span on the Latency Timeline. The zoom
in/out buttons are marked 2 in Figure 16-8.
3. Double-click the Latency Timeline slide bar to go back to display the full length of the latency
data.
3. In the Range Selector position box, select the radio button that identifies where you want the
timeline slide bar to appear; for example, if you want move the slide bar to the bottom of the
tab, select Bottom.
4. Select either Apply (if you want to set more preferences) or OK.
Note: For this change to take affect, you will need to close and reopen the particular recording.
3. Select Operative Set > Add selection or Operative Set > Set selection.
The Add selection option adds the events to an already existing operative set (or to a new
one).
The Set selection option clears and overrides the current operative set with the events that
you currently have selected.
3. Select Operative Set > Remove selection or Operative Set > Clear.
The Remove selection option deletes the currently selected events from an already existing
operative set.
The Clear option deletes all events from an already existing operative set.
Below is an explanation of what you can see in the Events Type view (Figure 16-12):
1. Producers are the part of the system that produced the events, for example, garbage collector
and the JRockit JVM. A producer can come from a third party that uses the latency recording
API.
2. Levels are a subdivision of producers. Two events within the same level and thread can never
be performed at the same time. Levels are best visualized when looking at a thread in the
Latency Graph tab (see Understanding the Different Parts of a Thread Image). There you see
that the thread is divided into several levels, but two events within a level overlap.
3. Event type is the actual type of event that was responsible for the latency.
You decrease (or increase) the amount of data displayed in the Latency Timeline by deselecting
events in the Event Types view (Figure 16-14).
2. Click on a specific event, a level, or a producer to select or deselect (see Using the Event
Types View to Decrease Displayed Events for an explanation of producer, level, and event).
The Latency Timeline in Figure 16-14 now looks something like Figure 16-15 when many of the
events have been removed. Notice how much easier it is to see differences over time.
2. Right-click a type in the Event Types view (see About the Event Types View for a description
of tab contents).
The context menu appears.
3. Select Operative Set > Add selection or Operative Set > Set selection.
The Add selection option adds the type to an already existing operative set (or to a new
one). Adding the event type to operative set adds all events of the selected type to the set.
The Set selection option clears and overrides the current operative set with the types that
you currently have selected.
3. Select Operative Set > Remove selection or Operative Set > Clear.
The Remove selection option deletes the currently selected events from an already existing
operative set.
The Clear option deletes all events from an already existing operative set.
Below is an explanation of what you can see on the Properties view (Figure 16-17):
Event General button. Shows keys and their respective values for
each event.
Stack Trace button. Shows the stack trace for a specific event.
2. List of information. This list changes content depending on the button you click in the tab.
For the second recording the same application has been used, but the calls to the logging system
has been removed, which causes a lot less latencies in the system. The second recording is named
pricing-server-no-logging.xml.zip (Figure 16-19). You see the difference both in the color
scheme and the Latency Timeline slide bar.
You can compare the two JRA recordings next to each other within JRA, which makes it easier
to see what has happened with the changes in the application (see To compare and contrast JRA
recordings for information on how to compare recordings).
Note: Before the recording finishes, you might be prompted to filter event information from the
recording because the number of events exceeds a defined threshold or your machine’s
capacity to handle all of them. See Filtering Latency Event Information for details.
Investigate further by opening the JRA recording, see 2. Open the JRA Recording in the Latency
Graph Tab.
Figure 16-23 Latency Traces tab with method that contains latencies
Investigate further by looking at the method that you have selected to the operative set in the
Latency Log tab, see 5. Look at Operative Set on the Latency Traces Tab.
because it takes too much time to process all the events in the user interface. To prevent problems
from occurring because of too many events being recorded, the JRockit Mission Control Client
allows you to filter out the following types of events:
z Events that were shorter than a certain threshold set in the recording loading wizard.
z Events in a certain time interval; for example, all events from 10 to 30 seconds.
z Events that belongs to certain thread. You can select a set of threads in a list box.
Select the criteria by which you want to filter the events and click Continue.
The report will continue to load, filtering events by the selected criteria.
The Latency Log tab lists the latency events that took place during the recording. By looking at
latency data in the Latency Log tab, you can easily find a specific event type or select an attribute
by using the sort and filter functions.
Note: The latency events that are recorded do not necessarily mean that they cause any
problems in the running of the application.
This section is divided into the following topics:
z Selecting an Event
1. Latency Timeline slide bar—this timeline shows the entire recording in its full length (the
Latency Timeline works the same on all tabs that start with the name Latency, see Using the
Latency Timeline Slide Bar for more information).
3. Event Table—the Event Table lists all events that took place during the recording.
4. Event Details—this panel lists the most common types on the heap at the end of the
recording.
5. Show only Operative Set—this option allows you to concentrate on studying the events that
you have chosen for your operative set (see What is an Operative Set? for a description of the
operative set and how to use it).
– Time since JRockit started: this view is useful when you have created a recording and
used a JRockit JVM that has, for example, been running on your network for a period
of time. This viewing option shows the time divided in hours, minutes, and seconds.
– Time since JRockit started in seconds: this view is useful when you have created a
recording and used a JRockit JVM that has, for example, been running on your network
for a period of time. This viewing option shows the time in seconds.
– Timestamp: this view shows actual time and date for when the event happened (on the
computer that is running your application).
z Selecting an Event
Selecting an Event
There are two places you can view the details for an event: on the Latency Log tab panel called
Event Details or in the Properties tab.
z To select an event and view its details under the Event Details
To select an event and view its details under the Event Details
1. Click the event for which you want to view details.
The event specifics are listed in the panel called Event Details (Figure 17-3).
You can also view the event specifics on the Properties tab
2. Click on the different tabs in the Event Details panel to see different aspects of detail for the
event.
Note: If you select several events, the Event Details tabs show the information for the event
that was selected first.
2. Click the General tab in the Event Details panel (Figure 17-4).
The following information can be found on the General tab. If something is marked N/A,
it means that there was no information for that piece of information during the recording.
– Index—a number that keeps track of each event in the recording.
– Start Time—indicates the time from when the recording was started (default). You can
change the default setting of the start time, see Changing Start Time View on an Event.
– End Time—indicates when the specific event stopped.
– Duration—the length of the event measured in milliseconds.
Use the filtering function to find, for example, a specific value, see Filtering Information.
See Also
Event Property Details allows you to jump to the method source code. For more information,
please refer to Jumping to Application Source.
2. Click the Stack Trace tab in the Event Details panel (Figure 17-6).
See Also
The Stack Trace tab allows you to jump to the method source code. For more information, please
refer to Jumping to Application Source.
z For a “File Write” event this is the number of bytes that were written.
z For a “Java Blocked” event, this is the class of the object the thread used as a lock along
with other information.
2. Select Open Method or Open Type (depending upon what you are jumping from).
The Latency Graph gives you a graphical overview of how the application executes and it is
easy to select events in terms of when they happened and in which thread. You have a possibility
to both zoom in on a shorter time interval and to magnify the threads themselves to better see the
different events that occurred in the thread.
This section is divided into the following topics:
z Magnifying a Thread
1. Latency Timeline slide bar with Move and Zoom buttons—this timeline shows the entire
recording in its full length (the Latency Timeline works the same on all tabs that start with the
name Latency, see Using the Latency Timeline Slide Bar for more information).
3. Thread list—a graphic representation of all threads in the recorded JRA file.
4. Thread magnifyer slide bar—this slide bar lets you magnify the thread you are studying.
This way you will better see each event within the thread.
6. Show GC backdrop and Show only Operative Set options—the Show GC backdrop
option allows you to see each garbage collection as fine lines behind each thread. The Show
only Operative Set option allows you to concentrate on studying the events that you have
chosen for your operative set (see What is an Operative Set? for a description of the operative
set and how to use it).
1. The thread itself. This is triggered by the Producer; that is, the part of the system that
produced an event for that thread, for example, the JRockit JVM.
2. The different levels of the thread. These are imaginary levels and depict that an event can only
take place in one level at a time within the same thread.
3. The events that have taken place in the thread. Each event type has its own color (can be
customized). The start and end of each thread event is marked by a thin black line. When you
hover over an event, you will get more information about that event.
Each thread in the Threads list contains events. A thread can also contain different levels within
the same thread (see Thread-14 in Figure 18-4 for an example of levels). To see the actual events
with some granularity, you can magnify the thread itself (see To zoom in on a thread by using the
magnifyer slide bar) and decrease the time span of the thread you are monitoring (see To decrease
the time span on a latency tab).
You can also view specific properties for each event as described in About the Properties View
or Hovering Over an Event. You can also get additional information about a specific thread by
hovering over it to open a tooltip.
1. On the elapsed time bar at the top of the Thread List, click the point in time for which you
want to correlate latency events.
The guide line will appear (Figure 18-5).
Guide Line
2. Scroll down to the first event you want to correlate and hover over the intersection of the
thread event and the guide line to display event information (Figure 18-6).
3. Scroll down to the next event you want to correlate and hover over the intersection of the
thread event and the guide line to display event information
4. To clear the guide line from the graph, simply click the top of it (the black triangle).
Magnifying a Thread
To get a better view at the events within a thread, you will probably need to magnify the thread
you are monitoring. There are two ways to better see events within a thread: magnify the thread
or zoom in on the time span that is used.
This section explains how to magnify a thread:
Minimize
2. Slide up to magnify and down to minimize the thread size.
Figure 18-8 shows a thread that has been magnified to its maximum size.
3. Slide up or down, using the side scroll bars, to find the thread you want to study.
4. Hover with the mouse over the thread, you will see details for each event in that thread
(Figure 18-9).
As you can see, the events appear as large chunks were there are many of the same type
and each event can be hard to see.
thread that is waiting because of an earlier call to Object.wait(). Figure 18-10 shows an example
of this feature.
z To enable this feature, select Show Transitions in the Latency Graph Tab.
z If you hold your pointer over a transition arrow, a tooltip will appear containing
information about the selected transition (Figure 18-11).
The Latency Traces tab contains a list of all methods that contain events with latencies. The
method traces with the most latencies are listed first. The Latency Traces table can be
customized to display specific packages, classes, and methods.
This section is divided into the following topics:
1. Latency Timeline slide bar—this timeline shows the entire recording in its full length (the
Latency Timeline works the same on all tabs that start with the name Latency, see Using the
Latency Timeline Slide Bar for more information).
2. Trace filters button—this button allows you to add and remove packages, classes, and
methods in the Traces table.
3. Traces table—the Traces table lists the packages and their events. The color coding of the
# Events and Latency columns gives you an overview of which package contains the events
that have the greatest latencies.
2. Click either the Add package, Add class, or Add method button.
The Add window opens (Figure 19-3 shows how to add a package).
3. Type in the prefix of the package, class, or method name, for example com.bea if you are
adding a package, to quickly find what you are looking for.
6. Click OK.
3. Click Remove.
4. Click OK.
Note: You can also deselect the Enable trace filters function to disable the filter.
JRA is equipped with a small text editor where you can add notes and comments about the
recording and your application. These comments will help the JRockit engineering team to
understand what has happened to the Oracle JRockit JVM and your application during the
recording (Figure 20-1).
To add a note
1. Enter a description of you application in the text field.
2. To save the message as part of the recording, use one of the options described in Table 20-1.
3. Click Save.