GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing javaevolved.dev — JFR for profiling | java.evolved
Tooling
Intermediate
JFR for profilingProfile 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
See a problem with this code? Let us know.
Why the modern way wins
🆓
Built-inNo external profiler to install or license. ⚡
Low overhead~1% performance impact — safe for production. 📊
Rich eventsCPU, 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%). Related Documentation
Related patterns
Tooling
Intermediate
Multi-file source launcherJava 8
$ javac *.java $ java Main // Must compile all files first // Need a build tool for dependencies Java 22+
$ java Main.java // Automatically finds and compiles // other source files referenced // by Main.java
JDK 22+
→
Tooling
Beginner
JShell for prototypingJava 8
// 1. Create Test.java // 2. javac Test.java // 3. java Test // Just to test one expression! Java 9+
$ jshell jshell> "hello".chars().count() $1 ==> 5 jshell> List.of(1,2,3).reversed() $2 ==> [3, 2, 1]
JDK 9+
→
Tooling
Beginner
Single-file executionJava 8
$ javac HelloWorld.java $ java HelloWorld // Two steps every time Java 11+
$ java HelloWorld.java // Compiles and runs in one step // Also works with shebangs: #!/usr/bin/java --source 25
JDK 11+
→
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |