Skip to content
Skills Library
Programming · Analysis

jvm-profiling

/jvm-profiling

Profile JVM services with async-profiler and JFR, separating CPU, allocation, and lock evidence, safely in production. Use when a JVM service is slow, hot, or memory-hungry and you need the cause.

Repository
AI-SKILLS ↗
Licence
MIT
Last repository change
05.09.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 05.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Profile JVM services with async-profiler and JFR, separating CPU, allocation, and lock evidence, safely in production. Use when a JVM service is slow, hot, or memory-hungry and you need the cause.

Original author description

Profile JVM services with async-profiler and JFR, separating CPU, allocation, and lock evidence, safely in production. Use when a JVM service is slow, hot, or memory-hungry and you need the cause.

How it works

  1. Method
  2. Boundaries
Original SKILL.md headings · 67 lines, 461 words
SKILL.md preview
---
name: jvm-profiling
description: Profile JVM services with async-profiler and JFR, separating CPU, allocation, and lock evidence, safely in production. Use when a JVM service is slow, hot, or memory-hungry and you need the cause.
---

# JVM profiling

The JVM ships production-safe profilers; there is no excuse for
guessing. The craft is picking the right profile type for the symptom
and reading past the framework noise to your code.

## Method

1. **Match the profile to the symptom.** High CPU: CPU sampling
   (async-profiler `-e cpu`, or JFR's execution samples). High GC or
   heap pressure: allocation profiling (`-e alloc`, JFR allocation
   events: sites by rate, feeding jvm-gc-selection's step 4). Slow
   but idle CPU: wall-clock/off-CPU profiling (`-e wall`) and lock
   profiling (`-e lock`, JFR monitor-blocked events): a service
   waiting on locks or downstreams shows nothing in CPU samples
   (the systems-profiling off-CPU rule, JVM edition).
2. **Use the safe tools, even in production.** async-profiler and
   JFR sample via safepoint-bias-free mechanisms at low overhead
   (~1-2%): suitable for production during incidents. Old
   instrumenting profilers and `hprof`-style tracing distort hot
   paths and belong nowhere near load. Continuous JFR recordings
   (ring buffer, dumped on incident) give you the profile of the
   problem that already happened (see production-debugging).
3. **Read flamegraphs from your frames outward.** Framework stacks
   (server threads, serialization, logging) dominate visually;
   find your packages' widest frames first, then judge the
   framework towers: wide JSON serialization means fat DTOs
   (see rest-endpoint-design projections), wide logging means
   log-level or string-building waste (see log-levels), wide
   `malloc`/GC frames mean allocation churn (see
   java-collections sizing, memory-optimization).
4. **Correlate with GC and thread state before concluding.**
   A "slow service" profile taken during a GC storm profiles the
   symptom, not the cause: check GC logs first (see
   jvm-gc-selection). Thread dumps (three, seconds apart) reveal
   pool starvation and deadlocks that samples smear
   (see deadlock-analysis, stack-trace-reading); JFR's thread
   states put numbers on runnable vs blocked vs waiting.
5. **Diagnose heap with dumps and dominator trees.** For footprint
   and leaks: heap dump into MAT-class tooling, dominator tree for
   retained size by root, histogram diff between two dumps for
   growth (see memory-leaks, jvm-gc-selection step 5). For "what
   is allocating", the allocation profile beats the heap dump:
   one shows standing stock, the other flow.
6. **Benchmark micro-claims with JMH, not loops.** JIT warmup,
   dead-code elimination, and OSR make naive timing loops lie;
   JMH handles warmup/forking/blackholes (the
   zero-cost-abstractions verification ethic on the JVM). Macro
   changes validate under load against SLO metrics (see
   benchmark-design, load-testing); a micro win that disappears
   at p99 was noise.

## Boundaries

- Profiles are per-workload evidence: staging profiles with fake
  data mislead on cache hit rates, JIT decisions, and data sizes;
  prefer production or production-shaped load
  (see test-environment-parity).
- Native memory (direct buffers, Netty arenas, JNI) escapes heap
  tools; native memory tracking (NMT) and OS-level maps cover the
  gap when container RSS exceeds heap math (see
  kubernetes-workloads memory budgeting).
- Kotlin coroutines and virtual threads restructure stacks;
  use profiler versions aware of them, or frames attribute to
  schedulers instead of your code.

Versions

The database has no other skills named jvm-profiling.

Database snapshot: 13.11.2026 · package version 0e8f3a4ab6d7 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100performance-tuning
    Finds and fixes the dominant cost in a slow JVM service: baseline metric, profile (JFR/async-profiler, traces, GC, locks), one fix, re-measure. Use for high latency, low throughput, CPU/memory/GC pressure or leaks. A single slow query goes to sql-optimization.
  • 100161-java-profiling-detect
    Use when you need to set up Java application profiling to detect and measure performance issues — including trusted preinstalled async-profiler v4.x setup, problem-driven profiling (CPU, memory, threading, GC, I/O), interactive profiling scripts, JFR integration with Java 25…
  • 100profile-run
    Runs this project under a profiler and analyses what comes out — a benchmark, a test, a load script or the application itself, recorded with JFR or async-profiler, imported into a running Jeffrey Microscope and handed to analyze-jfr. Use whenever the user wants to profile…
  • 100profile-run
    Runs this project under a profiler and analyses what comes out — a benchmark, a test, a load script or the application itself, recorded with JFR or async-profiler, imported into a running Jeffrey Microscope and handed to analyze-jfr. Use whenever the user wants to profile…
  • 100java-diagnostics
    Symptom-first runtime diagnostics for JVM applications using JDK tools: jcmd, jstack, jmap, jstat, JFR, GC logs, async-profiler, Native Memory Tracking, and Eclipse MAT. Use when a Java app has high CPU, memory leaks or OutOfMemoryError, slow startup, deadlocks or thread…
  • 95java-profiling
    JVM performance profiling with Java Flight Recorder (JFR), jcmd, and GC analysis. Use for identifying bottlenecks and memory issues. USE WHEN: user mentions "Java profiling", "JFR", "JVM performance", asks about "Java Flight Recorder", "jcmd", "heap dump", "GC tuning", "thread…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.