CtrlK
BlogDocsLog inGet started
Tessl Logo

testland/jvm-gc-tuning

Diagnoses JVM garbage-collection behaviour under load: reads and interprets unified GC logs (-Xlog:gc*), selects the right collector (G1 vs ZGC vs Parallel vs Serial), tunes heap sizing and pause-time targets, quantifies allocation rate, and traces the GC-pause-to-latency-tail link using GCViewer and Java Flight Recorder (JFR). Use when a load test reveals p99/p999 latency spikes that correlate with GC activity, or when heap sizing and collector selection need justification before a performance baseline is locked.

74

Quality

93%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Passed

No findings from the security scan

Overview
Quality
Evals
Security
Files

gc-reference.mdreferences/

JVM GC reference tables

Lookup tables for jvm-gc-tuning: G1 tuning flags, JFR event categories, and the metrics GCViewer surfaces. The runnable capture and analysis commands live in the main SKILL.md; these are the reference details each step points to.

Key G1 flags (Step 4)

From the G1 GC Tuning section:

FlagDefaultEffect
-XX:MaxGCPauseMillis200Pause-time target; G1 sizes young gen to meet this with high probability
-XX:InitiatingHeapOccupancyPercent45%Triggers concurrent marking when old gen occupancy reaches this level
-XX:G1HeapRegionSizeergonomic (~2048 regions)Region size 1-512 MB (power of 2); objects >= half this become humongous
-XX:G1MixedGCLiveThresholdPercent85%Regions with live occupancy above this are skipped during mixed GC
-XX:G1HeapWastePercent5%Space-reclamation phase ends when reclaimable space drops below this

G1 is not a real-time collector; the pause target is a statistical goal. Setting it below 10 ms without switching to ZGC typically causes G1 to thrash with very frequent tiny collections.

Key JFR event categories (Step 7)

Event categoryWhat to look for
jdk.GarbageCollectionDuration, cause, GC ID per collection
jdk.G1HeapSummaryEden/survivor/old occupancy before and after
jdk.ObjectAllocationInNewTLABAllocation call stacks (sampled)
jdk.ObjectAllocationOutsideTLABLarge object allocations (humongous)
jdk.GCHeapSummaryHeap used/committed at collection start

Key GCViewer metrics (Step 8)

MetricGC health interpretation
Throughput %% of time NOT in GC; target > 95% for most services
Avg pause timeMean STW duration; should be below MaxGCPauseMillis
Max pause timeWorst-case STW; the main driver of p99/p999 latency
Allocation rate (MB/s)Matches the Step 6 allocation-rate analysis
Promotion rate (MB/s)Objects escaping young gen; high rate fills old gen faster

references

SKILL.md

tile.json