Data analysis
- macOS and Windows limitation: Due to the lack of a public API for retrieving command-line
arguments for arbitrary processes on macOS and Windows, the
SystemProcessJFR event is currently limited to displaying only the executable path on these platforms. This limitation will be addressed when a suitable public API becomes available.
- View summary of the recording
- To obtain a high-level summary of the JFR recording, use the following
command.
$ jfr summary <filename>The jfr summary command provides a concise overview of a JFR recording. It lists the types of events captured, how many times each event occurred, and the total size each event type occupies in the recording file. This helps users quickly understand what kind of data has been collected and assess the recording’s composition without diving into detailed analysis.
Figure 1. jfr_summary 
- View metadata of the recording
- To display metadata information from the JFR recording, use the following
command.
$ jfr metadata <filename>This command prints the JFR metadata such as event structures and the data types of the fields as shown in the following sample. The JFR metadata is useful for understanding the context and structure of the data collected. It tells how the data is structured by describing the layout and schema of each event type recorded.
Figure 2. jfr_metadata 
- Print all events
- To display all the events captured in a JFR recording, use the following
command.
$ jfr print <filename>This displays the full list of events contained in the file specified in <filename>, for example, peak.jfr file as shown in the following example.
Analyzing the events recorded by JFR provides insights into an application's runtime behavior and performance characteristics. For example, analyzing class loading events can reveal critical information about the class loading characteristics. If the number of loaded classes keeps increasing over time without corresponding number of unloads, it could be a sign of a memory leak.
Figure 3. jfr_print 
- Print specific events
- To print specific events captured during the recording, use the jfr print
command with the
--eventsoption.$ jfr print --events "jdk.ExecutionSample" <filename>Figure 4. jfr_print_specific 
In this example, the
jdk.ExecutionSampleevent is a profiling event. It provides periodic snapshots of what the application threads are doing. It helps to identify bottlenecks or inefficient loops. It also helps to highlight which threads or methods are consuming a large amount of CPU and provides an insight into the activity in the background threads. - Print events in XML format
- To print the event data in XML format, use the following
command.
$ jfr print --xml --events "jdk.ExecutionSample" peak.jfrThis exports JFR event data as XML, which is useful for viewing structured event information, sharing data in a standard format, or processing with XML tools.
- Print events in JSON format
- To output the event data in JSON format, use the following
command.
$ jfr print --json --events "jdk.ExecutionSample" peak.jfrThe JSON output formats JFR event data in a way that is easy for many monitoring tools and programs to use. It’s helpful when you want to include JFR data in dashboards or analyze it with scripts written in languages like JavaScript or Python that work natively with JSON data
- Print events with stack depth
- To limit the number of frames when printing events that contain method call stacks, use the
following
command.
$ jfr print --stack-depth 10 --events "jdk.ExecutionSample" peak.jfrNote: The default frame count is 5.

