Java FAQ: Top Questions
63. What is the Java Flight Recorder (JFR)?
Java Flight Recorder (JFR) is a profiling and diagnostic tool in the JVM, introduced in Java 7 (commercial), open-sourced in Java 11, for collecting runtime performance and diagnostic data with low overhead.
- Events: Captures GC, thread, I/O, and custom events.
-
Usage:
Enabled via
-XX:StartFlightRecording
or programmatically. - Analysis: Viewed with Java Mission Control (JMC) or other tools.
- Overhead: Minimal, typically <1% performance impact.
- Use Case: Performance tuning, debugging, monitoring.