JDK Flight Recorder

Last updated

JDK Flight Recorder is an event recorder built into the OpenJDK [1] Java virtual machine. It can be thought of as the software equivalent of a Data Flight Recorder (Black Box) in a commercial aircraft. It captures information about the JVM itself, and the application running in the JVM. There is a wide variety of data captured, for example method profiling, allocation profiling and garbage collection related events. The JDK Flight Recorder was designed to minimize the Observer Effect in the profiled system, and is meant to be always on in production systems. The technology was open sourced in 2018.

Contents

Analysis and visualization of flight recordings are normally done using JDK Mission Control.

Technology

A recording file consists of binary chunks of data. Each chunk is self describing and self contained. In other words, the metadata (such as the datatype and the content type of each attribute) needed to make use of the data (not only parse the events, but actually use them) is included in the chunk. Also all the values required to be resolved through e.g. constant pools are also included in the chunk.

There is a wide variety of technologies employed to make the JFR efficient, for example:

If converting a binary recording to JSON, it can easily blow up by two orders of magnitude or more, depending on length and content recorded.

The expected performance overhead of JFR using the default template is less than a percent, and for the profiling template, less than two percent.

History

JDK Flight Recorder started out as JRockit Flight Recorder, and was originally used as a means to collect data to be used to improve the JVM itself. [2] [3] After Oracle acquired Sun Microsystems, JRockit Flight Recorder was rebranded Java Flight Recorder. [4] In 2018 Java Flight Recorder was open sourced and released as part of OpenJDK 11. [5] When open sourced it was rebranded JDK Flight Recorder, due to Java trademark issues.

Versions

These are the versions of JFR file format available. It does not encompass all the versions that have ever existed, but rather versions that exist in JVMs after the migration to HotSpot.

JFR VersionJDK Versions
v0.9Oracle JDK 7 (u4+), Oracle JDK 8
v1.0Oracle JDK 9, Oracle JDK 10
v2.0Oracle JDK 11+, Open JDK 11+, Azul JDK 8 and Azul JDK 11+

Development

The development of JDK Flight Recorder is taking place as part of the OpenJDK JDK [6] project on GitHub, [7] although most of the public discussions are taking place on the OpenJDK hotspot-jfr-dev [8] mailing list.

See also

Related Research Articles

<span class="mw-page-title-main">Java (programming language)</span> Object-oriented programming language

Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let programmers write once, run anywhere (WORA), meaning that compiled Java code can run on all platforms that support Java without the need to recompile. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the underlying computer architecture. The syntax of Java is similar to C and C++, but has fewer low-level facilities than either of them. The Java runtime provides dynamic capabilities that are typically not available in traditional compiled languages.

<span class="mw-page-title-main">Java virtual machine</span> Virtual machine that runs Java programs

A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describes what is required in a JVM implementation. Having a specification ensures interoperability of Java programs across different implementations so that program authors using the Java Development Kit (JDK) need not worry about idiosyncrasies of the underlying hardware platform.

javac is the primary Java compiler included in the Java Development Kit (JDK) from Oracle Corporation. Martin Odersky implemented the GJ compiler, and his implementation became the basis for javac.

HotSpot, released as Java HotSpot Performance Engine, is a Java virtual machine for desktop and server computers, developed by Sun Microsystems and now maintained and distributed by Oracle Corporation. It features improved performance via methods such as just-in-time compilation and adaptive optimization.

Apache Harmony is a retired open source, free Java implementation, developed by the Apache Software Foundation. It was announced in early May 2005 and on October 25, 2006, the board of directors voted to make Apache Harmony a top-level project. The Harmony project achieved 99% completeness for J2SE 5.0, and 97% for Java SE 6. The Android operating system has historically been a major user of Harmony, although since Android Nougat it increasingly relies on OpenJDK libraries.

<span class="mw-page-title-main">Java (software platform)</span> Set of computer software and specifications

Java is a set of computer software and specifications that provides a software platform for developing application software and deploying it in a cross-platform computing environment. Java is used in a wide variety of computing platforms from embedded devices and mobile phones to enterprise servers and supercomputers. Java applets, which are less common than standalone Java applications, were commonly run in secure, sandboxed environments to provide many features of native applications through being embedded in HTML pages.

The Java language has undergone several changes since JDK 1.0 as well as numerous additions of classes and packages to the standard library. Since J2SE 1.4, the evolution of the Java language has been governed by the Java Community Process (JCP), which uses Java Specification Requests (JSRs) to propose and specify additions and changes to the Java platform. The language is specified by the Java Language Specification (JLS); changes to the JLS are managed under JSR 901. In September 2017, Mark Reinhold, chief Architect of the Java Platform, proposed to change the release train to "one feature release every six months" rather than the then-current two-year schedule. This proposal took effect for all following versions, and is still the current release schedule.

OpenJDK is a free and open-source implementation of the Java Platform, Standard Edition. It is the result of an effort Sun Microsystems began in 2006. The implementation is licensed under the GPL-2.0-only with a linking exception. Were it not for the GPL linking exception, components that linked to the Java Class Library would be subject to the terms of the GPL license. OpenJDK is the official reference implementation of Java SE since version 7.

The Java Class Library (JCL) is a set of dynamically loadable libraries that Java Virtual Machine (JVM) languages can call at run time. Because the Java Platform is not dependent on a specific operating system, applications cannot rely on any of the platform-native libraries. Instead, the Java Platform provides a comprehensive set of standard class libraries, containing the functions common to modern operating systems.

IcedTea is a build and integration project for OpenJDK launched by Red Hat in June 2007. IcedTea also includes some addon libraries: IcedTea-Web is a free software implementation of Java Web Start and the Java web browser applet plugin. IcedTea-Sound is a collection of plugins for the Java sound subsystem, including the PulseAudio provider which used to be included with IcedTea. The Free Software Foundation recommends that all Java programmers use IcedTea as their development environment.

Eclipse OpenJ9 is a high performance, scalable, Java virtual machine (JVM) implementation that is fully compliant with the Java Virtual Machine Specification.

<span class="mw-page-title-main">Azul Systems</span> Computer manufacturer of appliances for executing Java-based applications

Azul Systems, Inc. develops runtimes for executing Java-based applications. Founded in March 2002, Azul Systems has headquarters in Sunnyvale, California.

Protocol Buffers (Protobuf) is a free and open-source cross-platform data format used to serialize structured data. It is useful in developing programs that communicate with each other over a network or for storing data. The method involves an interface description language that describes the structure of some data and a program that generates source code from that description for generating or parsing a stream of bytes that represents the structured data.

VisualVM is a tool that provides a visual interface for viewing detailed information about Java applications while they are running on a Java Virtual Machine (JVM). VisualVM organizes JVM data that is retrieved by the Java Development Kit (JDK) tools and presents the information in a way that allows data on multiple Java applications to be quickly viewed—both local applications and applications that are running on remote hosts. Programmers can also capture data about the JVM software and save the data to the local system, and then view the data later or share it with others. VisualVM is built on the NetBeans Platform; its architecture is modular and easy to extend with plugins.

The Java Development Kit (JDK) is a distribution of Java Technology by Oracle Corporation. It implements the Java Language Specification (JLS) and the Java Virtual Machine Specification (JVMS) and provides the Standard Edition (SE) of the Java Application Programming Interface (API). It is derivative of the community driven OpenJDK which Oracle stewards. It provides software for working with Java applications. Examples of included software are the virtual machine, a compiler, performance monitoring tools, a debugger, and other utilities that Oracle considers useful for a Java programmer.

Nashorn is a JavaScript engine developed in the Java programming language originally by Oracle and later by the OpenJDK Community. It relies on the support for dynamically typed languages on the Java Platform Nashorn has been included with Java 8 through JDK 14.

<span class="mw-page-title-main">GraalVM</span> Virtual machine software

GraalVM is a Java Development Kit (JDK), written in Java. The open-source distribution of GraalVM is based on OpenJDK, and the enterprise distribution is based on Oracle JDK. As well as just-in-time (JIT) compilation, GraalVM can compile a Java application ahead-of-time so that it starts instantly, provides peak performance with no warmup, and uses fewer resources. It provides additional programming languages and execution modes. The first production-ready release, GraalVM 19.0, was distributed in May 2019. The most recent release is GraalVM for JDK 21, made available in September 2023.

<span class="mw-page-title-main">JDK Mission Control</span> Production time profiling and diagnostics for OpenJDK

JDK Mission Control is an open source tools suite for the Java virtual machine. The tools help finding problems in, and optimizing, programs running on the JVM in production. JDK Mission Control supports OpenJDK 11 and Oracle JDK 7u40.

References

  1. "OpenJDK" . Retrieved 28 June 2023.
  2. "JRockit Flight Recorder Runtime Guide" (PDF). Retrieved 22 January 2019.
  3. Oracle JRockit: the Definitive Guide. Packt Pub. 2010. p. 588. ISBN   978-1847198068.
  4. "Java Flight Recorder Runtime Guide" . Retrieved 22 January 2019.
  5. "JEP 328: Flight Recorder" . Retrieved 22 January 2019.
  6. "OpenJDK JDK Project" . Retrieved 28 June 2023.
  7. "GitHub OpenJDK JDK" . Retrieved 28 June 2023.
  8. "hotspot-jfr-dev mailing list" . Retrieved 28 June 2023.