agentsclimarketplace

Async profiler

Skill umit/skills/skills/async-profiler

My personal agent skills — JVM profiling, GC, concurrency, distributed systems. Compatible with Claude Code, Codex, Cursor, Cline, and any agent that supports the skills.sh format.

Install
npx -y skills add umit/skills --skill async-profiler

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 5 stars5 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Profile JVM applications with async-profiler — sampling-based CPU, allocation, lock, wall-clock, and hardware-counter profiling that produces flame graphs, JFR, and pprof. Use this skill whenever the user investigates JVM performance, mentions hot methods or hot paths, asks about flame graphs, JFR, async-profiler, asprof, libasyncProfiler, jfrconv, or AsyncGetCallTrace, debugs allocation pressure or GC churn, hunts lock or monitor contention, traces latency spikes or time-to-safepoint issues, profiles a Java/Kotlin/Scala/Clojure process, sets up production-safe continuous profiling, or compares before/after performance with differential flame graphs. Use it even when the user only describes the symptom (e.g., "my JVM uses 100% CPU", "young GC is firing constantly", "threads are stuck") without naming the tool — async-profiler is the default JVM profiling choice over JFR-only and VisualVM.

SKILL.md

6.4 KB, as published. Nobody here has run it

async-profiler

Low-overhead sampling profiler for JVMs (HotSpot, OpenJ9, GraalVM CE) that combines AsyncGetCallTrace with perf_events to produce accurate stack traces — including Java, JIT-inlined, native, and kernel frames.

The body below is the workflow. Detailed knowledge lives in references/ and is loaded only when needed.

Workflow

  1. Identify the JVMjps -v, jcmd, or pgrep -f java in a container. Confirm the workload has reached steady state; profiles taken during JIT warmup are dominated by C2 CompilerThread and don't reflect real hot paths.

  2. Pick the event based on the symptom. If the user gave a symptom but not the event, choose for them and explain the choice. See references/events.md for the full list including hardware counters.

    SymptomEvent
    High CPU, slow throughputcpu
    Low CPU but slow latencywall (samples threads in any state)
    Frequent young GC, GC pressurealloc
    Thread dump full of BLOCKED/WAITINGlock
    Memory-bound suspicion (large data scans)hardware cache-misses
    GC pauses longer than expected--ttsp (time-to-safepoint)
    Container without perf permissionsitimer (fallback)
  3. Pick the attach mode. See references/attach-modes.md for full details.

    • PID attach — running JVM, ad-hoc: asprof -d 30 -f cpu.html <pid>
    • -agentpath — captures startup; needed when -XX:+DisableAttachMechanism is set
    • Programmatic API — embed in tests, expose via internal HTTP endpoint
  4. Pick the duration. 30–120s ad-hoc; for production use rotating JFR (scripts/continuous-jfr.sh). Long enough to capture steady-state behavior; short enough to keep file size manageable.

  5. Capture as JFR when possible, render flame graphs from it. JFR is re-renderable — you can re-filter by thread, exclude packages, or diff against another recording without re-profiling. Pure HTML output is frozen.

  6. Analyze the flame graph. Width = samples (not time). Wide plateaus near the top are direct hotspots. Wide trunks at the bottom are entry frames — drill upward to find your code. See references/flame-graphs.md for color semantics, search, and reading patterns.

  7. Verify the change. After modifying code, re-profile under the same workload (same RPS, same input) and run jfrconv --diff baseline.jfr current.jfr diff.html. Blue frames in changed code paths confirm improvement; red signals regression.

Quick command reference

GoalCommand
30s CPU flame graphasprof -d 30 -f cpu.html <pid>
Allocation profileasprof -e alloc -d 60 -f alloc.html <pid>
Lock contentionasprof -e lock --lock 1ms -d 60 -f lock.html <pid>
Wall-clock (off-CPU visible)asprof -e wall -t -d 60 -f wall.html <pid>
Time-to-safepointasprof --ttsp -d 60 -f ttsp.html <pid>
Continuous start/stopasprof start -e cpu <pid> ... asprof stop -f out.jfr <pid>
List events for a PIDasprof list <pid>
Convert JFR to flame graphjfrconv --cpu profile.jfr profile.html
Differential flame graphjfrconv --diff baseline.jfr current.jfr diff.html

Helper scripts

Located in scripts/. Read a script before suggesting it; each encodes safe defaults.

ScriptPurpose
scripts/install.shDownload and install latest async-profiler for the current platform
scripts/attach.sh <pid> [event] [seconds]One-shot attach and flame graph
scripts/continuous-jfr.sh <pid> [rotate] [dir]Rotating JFR for production with hostname/PID-tagged output
scripts/diff-profiles.sh <baseline> <current> [out]Differential flame graph wrapping jfrconv --diff

References

Read on demand. Each file is self-contained.

FileWhen to read
references/events.mdPicking the right event; full list including hardware counters and method-tracing
references/attach-modes.mdChoosing PID-attach, -agentpath, programmatic API, or jcmd integration
references/flags.mdComplete CLI flag reference with examples
references/output-formats.mdflamegraph / jfr / collapsed / pprof / tree — when to use each
references/flame-graphs.mdReading flame graphs: color semantics, search, differential, gotchas
references/jfr.mdJFR analysis with jfrconv, JMC, IntelliJ Profiler, Jeffrey
references/pitfalls.mdInlining, container limits, kernel perms, sampling skew, virtual threads
references/platform-notes.mdLinux vs macOS vs Docker vs Kubernetes vs cloud (Lambda, Cloud Run)
references/workflows.mdEnd-to-end scenarios — latency spike, alloc churn, deadlock, GC, A/B compare
references/api.mdProgrammatic Java API; embedding in tests and health endpoints
references/integration.mdJMH, Spring Boot, Quarkus, Pyroscope, Parca, IntelliJ, Datadog

Output format

When reporting profile findings to the user:

  • State the question first — "You asked about X; here's what the profile shows."
  • Show the top frame(s) with sample share — "com.acme.Foo.bar is 42% of CPU samples."
  • Explain why it's hot, not just that it is — "It builds a regex on every call; cache the compiled Pattern."
  • Recommend a concrete next step — code change, follow-up profile with a different event, or diff after the fix.
  • Link the artifact — full path to the .html or .jfr file so the user can open it.

Avoid dumping full flame graph trees as text; the visual artifact is the deliverable.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.