Jump to content

JDK Flight Recorder

From Alfawiki
JDK Flight Recorder
Company typeSoftware tool
IndustrySoftware, Java Virtual Machine
Founded2018
ProductsEvent logging, JVM profiling

JDK Flight Recorder is an integrated event logging tool within the OpenJDK Java virtual machine. Serving as a software counterpart to an aircraft's Data Flight Recorder, it captures detailed information about the JVM and the applications executing on it. The recorder gathers a variety of metrics, including method and allocation profiling as well as garbage collection events. Engineered to reduce the Observer Effect significantly, it is suitable for continuous operation in live production systems. This technology was made open source in 2018.

Flight data captured by JFR is commonly examined and visualized through JDK Mission Control.

Technology

Recording files produced by JFR consist of binary data segments that are both self-describing and self-contained, embedding metadata along with all necessary information for parsing and analysis.

Several core technologies contribute to JFR’s performance optimization:

  • Data is stored in binary form, avoiding expensive string conversions and allowing rapid disk writes
  • The majority of events are logged in thread-local native buffers
  • On certain platforms, an invariant TSC is utilized for accurate timestamping
  • Integer compression techniques help minimize memory usage and file size
  • Deep JVM integration grants access to readily available data with minimal performance cost

Transforming these recordings into JSON format can cause file sizes to increase by factors of 100 or more.

Using the default recording template results in performance overhead below 1%, while the profiling template maintains overhead under 2%.

History

Originally developed as JRockit Flight Recorder to support JVM enhancement efforts, this tool was rebranded Java Flight Recorder following Oracle’s acquisition of Sun Microsystems. In 2018, it transitioned to open source status and was integrated into OpenJDK 11. Due to trademark restrictions associated with Java, it adopted the name JDK Flight Recorder.

Versions

The following table outlines JFR file format versions compatible with JVMs after migrating from HotSpot:

JFR Version Supported JDK Versions
v0.9 Oracle JDK 7 (update 4 and later), Oracle JDK 8
v1.0 Oracle JDK 9, Oracle JDK 10
v2.0 Oracle JDK 11 and newer, OpenJDK 11 and newer, Azul JDK 8 and Azul JDK 11+

Development

The evolution of JDK Flight Recorder takes place within the OpenJDK JDK project hosted on GitHub. Key discussions occur on the OpenJDK hotspot-jfr-dev mailing list.

See also