Why JFR, JMC and MCP Work Together
Bridging low-overhead JVM diagnostic profiling with AI reasoning models using structured runtime facts.
Java Flight Recorder (JFR)
Built into OpenJDK with sub-1% production overhead. Records exact hardware thread samples, lock contention timelines, memory allocation churn, and GC pauses directly inside the JVM kernel.
- Continuous ring-buffer in-memory capture
- Zero external agent or bytecode instrumentation
- Deterministic, nanosecond-precision event timestamps
JDK Mission Control (JMC)
The authoritative desktop interface for inspecting JVM flight recordings. Provides call trees, method flame graphs, lock duration scatter plots, and memory consumption timelines for human verification.
- Visual verification of hotspot methods
- Thread timeline and blocking dependencies
- Independent ground-truth cross-check
JFR Performance MCP
Exposes 11 specialized diagnostic tools over the Model Context Protocol (MCP). Extracts verified measurements from .jfr files and presents them to AI assistants with calibrated confidence.
- Strict separation of facts vs. hypotheses
- Directory-confined safe read-only execution
- Direct integration with Google Antigravity & IDEs
The Evidence-Driven Workflow
A systematic 4-step path from symptom reproduction to validated code correction.
Trigger Workload
Launch a controlled scenario from jfr-performance-demo-app with bounded duration, deterministic concurrency, and safety guards.
Capture JFR Recording
Stream execution samples, lock events, and GC pauses directly to a .jfr artifact via automated runner script or jcmd.
Analyze via MCP
Ask your AI assistant to triage the recording. The MCP server computes hotspot methods, evaluates contention, and reports structured findings.
Validate the Fix
Apply the optimized code pattern, capture a comparison recording, and quantitatively prove latency and throughput gains.
Featured Performance Investigations
Hands-on investigation guides based on production anti-patterns with exact reproduction steps.
CPU Hotspot
CPUjdk.ExecutionSampleRedundant polynomial discount calculations consume CPU cycles in pricing calculation.
View Playbook →Thread Contention
Locksjdk.JavaMonitorEnterCoarse synchronized lock on shared inventory causes severe thread serialization.
View Playbook →Allocation & GC Pressure
Memoryjdk.ObjectAllocationSampleIntermediate map and string allocations trigger excessive Eden churn and GC pauses.
View Playbook →Thread Pool Starvation
Threadsjdk.ThreadParkUndersized executor queues cause worker starvation and latency spikes.
View Playbook →Slow Downstream I/O
I/Ojdk.ThreadPark (Low CPU)Network delays from downstream payment APIs without consuming JVM CPU.
View Playbook →Exception Storm
Runtimejdk.JavaExceptionThrowUsing exceptions for normal validation control flow inflates stack trace costs.
View Playbook →Quick-Start Preview
Run a complete investigation cycle in three shell commands.