mcpField
J
java-performance

java-performance

github.com/pluginagentmarketplaceDevelopment41484 installsUpdated 42w ago
Repository

About java-performance

A skill for Java developers optimizing JVM performance, covering GC tuning, memory analysis, CPU profiling, and JMH benchmarking, with guidance for common troubleshooting cases.

Key features

  1. 01GC tuning guidance
  2. 02Memory and leak analysis
  3. 03CPU hotspot profiling
  4. 04JMH benchmarking
  5. 05Container settings optimization

Use cases

  1. 01Tune GC for latency or throughput
  2. 02Locate CPU hotspots
  3. 03Investigate memory leaks
  4. 04Benchmark code performance

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pluginagentmarketplace/custom-plugin-java --skill java-performance

After installing, type/java-performancein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

assets/
config.yaml
jvm-options.yaml
schema.json
references/
GUIDE.md
PATTERNS.md
scripts/
validate.py

Details

From the project README

Java Performance Skill

Optimize JVM performance through profiling, GC tuning, and memory analysis.

Overview

This skill covers JVM performance optimization including garbage collection tuning, memory analysis, CPU profiling, and benchmarking with JMH.

When to Use This Skill

Use when you need to:

  • Tune GC for low latency or throughput
  • Profile CPU hotspots
  • Analyze memory leaks
  • Benchmark code performance
  • Optimize container settings

Quick Reference

GC Presets
# High-throughput
-XX:+UseG1GC
-XX:MaxGCPauseMillis=200
-Xms4g -Xmx4g
-XX:+AlwaysPreTouch

# Low-latency
-XX:+UseZGC
-XX:+ZGenerational
-Xms8g -Xmx8g

# Memory-constrained
-XX:+UseSerialGC
-Xms512m -Xmx512m
-XX:+UseCompressedOops

# Container-optimized
-XX:+UseContainerSupport
-XX:MaxRAMPercentage=75.0
-XX:+ExitOnOutOfMemoryError
Profiling Commands
# Thread dump
jstack -l <pid> > threaddump.txt

# Heap dump
jmap -dump:format=b,file=heap.hprof <pid>

# GC analysis
jstat -gcutil <pid> 1000 10

# Flight recording
jcmd <pid> JFR.start duration=60s filename=app.jfr

# Async profiler
./profiler.sh -d 30 -f profile.html <pid>
JMH Benchmark
@BenchmarkMode(Mode.Throughput)
@Warmup(iterations = 3, time = 1)
@Measurement(iterations = 5, time = 1)
@State(Scope.Benchmark)
public class MyBenchmark {

    @Benchmark
    public void testMethod(Blackhole bh) {
        bh.consume(compute());
    }
}

GC Comparison

GCLatencyThroughputHeap Size
G1MediumHigh4-32GB
ZGCVery LowMedium8GB-16TB
ShenandoahVery LowMedium8GB+
ParallelHighVery HighAny

Troubleshooting

ProblemCauseSolution
GC thrashingHeap too smallIncrease heap
High latencyGC pausesSwitch to ZGC
Memory leakObject retentionHeap dump + MAT
CPU spikesHot loopsProfile + optimize

Usage

Skill("java-performance")

Comments

Markdown supported