Documentation Contents
Java Platform, Standard Edition Troubleshooting Guide
Contents    Previous    Next

2.5 Inspect a Flight Recording

The topic describes how to get a sample JFR to inspect a flight recording and describes various tabs in Java Mission Control for you to analyze the flight recordings. The following sections are described:

2.5.1 How to Get a Sample JFR to Inspect

After you create a Flight Recording, you can open it in Mission Control. An easy way to look at a flight recording is:

  • Open Mission Control and select the JVM Browser tab.

  • Select The JVM Running Mission Control option to create a short recording.

Another way is to download Demos and Samples, and open one of the recordings from sample\missioncontrol\flightrecordings\. The wldf.jfr recording is a sample recording from an application server, which is used as an example in the following sections.

Open a flight recording to see several main tabs such as General, Memory, Code, Threads, I/O, System, and Events. You can also have other main tabs if any plug-ins are installed. Each of these main tabs have sub tabs. Click the question mark to view the built-in help section for the main tabs and subtabs.

2.5.2 Range Navigator

Each tab has a range navigator at the top view.

The vertical bars in Figure 2-8 represent the events in the recording. The higher the bar, the more events there are at that time. You can drag the edges of the selected time to zoom in or out in the recording. Double click the range navigator to zoom out and view the entire recording. Click the Synchronize Selection check box for all the subtabs to use the same zoom level.

See Using the Range Navigator in the built-in help for more information. The events are named as per the tab name.

2.5.3 General Tab

The General Tab contains a few subtabs that describe the general application. The first subtab is Overview, which shows some basic information such as the maximum heap usage, total CPU usage, and GC pause time, as shown in Figure 2-9.

Also, look at the CPU Usage over time and both the Application Usage and Machine Total. This tab is good to look at when something that goes wrong immediately in the application. For example, watch for CPU usage spiking near 100 percent or the CPU usage is too low or too long garbage collection pauses.

Note: A profiling recording started with Heap Statistics gets two old collections, at the start and the end of the recording that may be longer than the rest.

The other subtab - JVM Information shows the JVM information. The start parameters subtabs - System Properties shows all system properties set, and Recording shows information about the specific recording such as, the events that are turned on. Click the question marks for built-in detailed information about all tabs and subtabs.

2.5.4 Memory Tab

The Memory tab contains information about Garbage Collections, Allocation patterns and Object Statistics. This tab is specifically helpful to debug memory leaks as well as for tuning the GC.

The Overview tab shows some general information about the memory usage and some statistics over garbage collections. Note: The graph scale in the Overview tab goes up to the available physical memory in the machine; therefore, in some cases the Java heap may take up only a small section at the bottom.

The following three subtabs are described from the Memory tab.

2.5.5 Code Tab

The Code tab contains information about where the application spends most of its time. The Overview subtab shows the packages and classes that spent the most execution time. This data comes from sampling. JFR takes samples of threads running at intervals. Only the threads running actual code are sampled; the threads that are sleeping, waiting for locks or I/O are not shown.

To see more details about the application time for running the actual code, look at the Hot Methods subtab.

Figure 2-13 shows the methods that are sampled the most. Expand the samples to see from where they are called. If a HashMap.getEntry is called a lot, then expand this node until you find the method that called the most. This is the best tab to use to find bottlenecks in the application.

The Call Tree subtab shows the same events, but starts from the bottom; for example, from Thread.run.

The Exceptions sub tab shows any exceptions thrown. By default, only Errors are logged, but change this setting to include All Exceptions when starting a new recording.

The Compilations sub tab shows the methods compiled over time as the application was running.

The Class Loading sub tab shows the number of loaded classes, actual loaded classes and unloaded classes over time. This sub tab shows information only when Class Loading events were enabled at the start of the recording.

For more details about these tabs, click the question mark in the top right corner to see the built-in help.

2.5.6 Threads Tab

The Threads tab contains information about threads, lock contention and other latencies.

The Overview subtab shows CPU usage and the number of threads over time.

The Hot Threads sub tab shows the threads that do most of the code execution. This information is based on the same sampling data as the Hot Methods subtab in the Code tab.

The Contention tab is useful for finding bottle necks due to lock contention.

Figure 2-14 shows objects that are the most waited for due to synchronization. Select a Class to see the Stack Trace of the wait time for each object. These pauses are generally caused by synchronized methods, where another thread holds the lock. Note: By default, only synchronization events longer than 10 ms will be recorded, but you can lower this threshold when starting a recording.

The Latencies subtab shows other sources of latencies; for example, calling sleep or wait, reading from sockets, or waiting for file I/O.

The Thread Dumps subtab shows the periodic thread dumps that can be triggered in the recording.

The Lock Instances subtab shows the exact instances of objects that are waited upon the most due to synchronization.

For more details about these tabs, click the question mark in the top right corner to see the built-in help.

2.5.7 I/O Tab

The I/O tab shows information on file reads, file writes, socket reads, and socket writes. This tab is helpful depending on the application; especially, when any I/O operation takes a long time. Note: By default, only events longer than 10 ms are shown. The thresholds can be modified when creating a new recording.

2.5.8 System Tab

The System tab gives detailed information about the CPU, Memory and OS of the machine running the application. It also shows environment variables and any other processes running at the same time as the JVM.

2.5.9 Events Tab

The Events tab shows all the events in the recording. This is an advanced tab that can be used in many different ways. For more details about these tabs, click the question mark in the top right corner to see the built-in help.

Contents    Previous    Next

Oracle and/or its affiliates Copyright © 1993, 2019, Oracle and/or its affiliates. All rights reserved.
Contact Us