JFR for profiling
Profile any Java app with the built-in Flight Recorder — no external tools.
Code Comparison
✕ Java 8
// Install VisualVM / YourKit / JProfiler // Attach to running process // Configure sampling // Export and analyze // External tool required
✓ Java 9+
// Start with profiling enabled
$ java -XX:StartFlightRecording=
filename=rec.jfr MyApp
// Or attach to running app:
$ jcmd <pid> JFR.start
Why the modern way wins
Built-in
No external profiler to install or license.
Low overhead
~1% performance impact — safe for production.
Rich events
CPU, memory, GC, threads, I/O, locks, and custom events.
Old Approach
External Profiler
Modern Approach
Java Flight Recorder
Since JDK
9
Difficulty
intermediate
JDK Support
JFR for profiling
Available
Widely available since JDK 9/11 (open-sourced in 11)
How it works
Java Flight Recorder (JFR) is a low-overhead profiling tool built into the JVM. It captures events for CPU, memory, GC, I/O, threads, and custom events with minimal performance impact (~1%).