Skip to content

github/awesome-copilot / skills/java-diagnostics

java-diagnostics

Verified

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 starvation, long GC pauses, native memory growth, or slow requests. Includes permission tiers for safe use.

FileKindSize
SKILL.mdskill md7.2 KB
references/async-profiler.mdmarkdown3.0 KB
references/containers.mdmarkdown1.7 KB
references/gc.mdmarkdown1.6 KB
references/heap.mdmarkdown3.0 KB
references/jcmd-basics.mdmarkdown1.9 KB
references/jfr.mdmarkdown2.3 KB
references/native-memory.mdmarkdown1.5 KB
references/thread-dumps.mdmarkdown3.3 KB

references/gc.md

View on GitHub
# GC logs and jstat

## Unified GC logging (JDK 9+)

Enabling at startup is a restart, so treat it as Tier 2; overhead is low.

```
-Xlog:gc*=info:file=/var/log/app/gc.log:time,uptime,level,tags:filecount=5,filesize=20m
```

On a running JVM (Tier 2):

```bash
jcmd <pid> VM.log what=gc*=info output=gc.log decorators=uptime,time
jcmd <pid> VM.log list
```

JDK 8 uses `-XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:gc.log` instead.

## jstat (Tier 1)

```bash
jstat -gcutil <pid> 1000 10      # utilization %, sampled every 1s, 10 times
jstat -gc <pid> 1000 10          # capacities and sizes in KB
jstat -gccause <pid> 1000 5      # last GC cause
```

Watch: Old (`O`) occupancy after each full/mixed GC. If it keeps ratcheting up, suspect a leak (see [heap](heap.md)). Rising `FGC`/`FGCT` means frequent full GCs.

## Interpreting

- Long pauses: look at pause time per event and the cause (`Allocation Failure`, `Humongous Allocation`, `Metadata GC Threshold`, `System.gc()`).
- Frequent young GCs with high promotion: allocation rate too high or young gen too small.
- Heap near max after GC: heap too small or leak; do not just raise `-Xmx` without checking.
- Pause target: G1 default `-XX:MaxGCPauseMillis=200`; ZGC and Shenandoah target sub-millisecond-class pauses with more CPU/memory overhead. Change one tuning flag at a time and compare logs.
- Tools such as GCeasy or GCViewer can visualize logs, but GC logs may reveal internal hostnames and sizing; do not upload from sensitive environments.
- JFR also records GC events (`jdk.GarbageCollection`, `jdk.GCPhasePause`); see [jfr](jfr.md).
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 197kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall