spring-jfr

Profile Java 21 Spring Boot services with JFR recordings and jcmd.

Updated Feb 25, 2026
One-click install
npx skills add https://github.com/zenobiuszeto/banking-strawman-capabilities --skill spring-jfr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spring-jfr
Source: https://github.com/zenobiuszeto/banking-strawman-capabilities/tree/main/skills/spring-jfr
Command: npx skills add https://github.com/zenobiuszeto/banking-strawman-capabilities --skill spring-jfr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides safe, low-overhead production profiling for Java 21 Spring Boot services so engineers can diagnose CPU hotspots, allocation pressure, GC behavior, lock contention, and virtual-thread pinning without causing significant additional load or lengthy downtime.

Core Features & Use Cases

  • Continuous Production Recording: Configure always-on JFR continuous recordings with ring buffers and dumponexit to capture crash and incident data.
  • Targeted Deep Dives: Start/stop profile recordings via jcmd or RecordingStream for high-detail captures and use Async Profiler for precise CPU and allocation flamegraphs.
  • Programmatic Monitoring & Custom Events: Emit custom JFR events and stream them in real time for anomaly detection, slow-method alerts, and contention logging within Spring Boot.
  • Kubernetes & Forensic Workflows: Safe pod-level commands to trigger recordings, copy artifacts out for JMC analysis, and recommended actuator/heapdump policies for restricted access.

Quick Start

Start a 2-minute profile on the running BankingPlatform JVM, dump the recording to /tmp/profile.jfr, and provide a short summary of top CPU hotspots, lock contention, and significant GC events.

Frequently Asked Questions about spring-jfr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I profile a live Java Spring Boot service in production without causing downtime?

Production-safe JVM profiling uses JFR to collect low-overhead diagnostic recordings on live Java services. You configure always-on continuous recordings with ring buffers and dumponexit to capture incident data without significant additional load or downtime.

How do I capture CPU hotspots and allocation pressure in a Java 21 application?

To capture CPU hotspots and allocation pressure, start targeted deep-dive JFR recordings via jcmd or RecordingStream. You then analyze the dumped JFR files and generate precise CPU and allocation flamegraphs using Async Profiler for detailed inspection.

Does JFR profiling work with Java 21 virtual threads and ZGC?

JFR profiling works with Java 21 Spring Boot applications running ZGC with virtual threads. It specifically diagnoses CPU hotspots, allocation pressure, GC behavior, lock contention, and virtual-thread pinning during incidents and performance regressions.

What is the best way to analyze JFR files for lock contention and GC behavior?

The best way to analyze JFR files for lock contention and GC behavior is using JMC. You copy the JFR recording artifacts out of your service, such as from Kubernetes pods, and use JMC alongside Async Profiler flamegraphs for comprehensive forensic analysis.

How do I monitor custom JFR events in real time within a Spring Boot application?

Real-time monitoring of custom JFR events in Spring Boot involves emitting custom JFR events and streaming them via RecordingStream. This enables anomaly detection, slow-method alerts, and contention logging directly during application runtime.

What precautions are needed when triggering heap dumps and JFR recordings on Kubernetes?

Safe pod-level Kubernetes workflows require restricted actuator exposure and specific heapdump policies. You control recording depth with stackdepth configurations and use jcmd to trigger safe recordings, preventing excessive load during forensic data capture.