JVM Performance Optimization

Tune JVM garbage collection and memory settings for Java applications.

1|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/iceflower/opencode-agents-and-skills --skill jvm-performance-optimization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: JVM Performance Optimization
Source: https://github.com/iceflower/opencode-agents-and-skills/tree/main/skills/jvm-performance
Command: npx skills add https://github.com/iceflower/opencode-agents-and-skills --skill jvm-performance-optimization

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses performance bottlenecks in Java applications by providing guidance on JVM tuning, garbage collection, and profiling techniques.

Core Features & Use Cases

  • Garbage Collection Tuning: Select and configure appropriate GC algorithms (Serial, Parallel, G1, ZGC, Shenandoah) based on application needs and heap size.
  • Memory Management: Optimize heap, young generation, and metaspace settings.
  • Profiling & Analysis: Utilize tools like JFR, JMC, and async-profiler to diagnose issues and identify memory leaks or CPU hotspots.
  • Use Case: A high-traffic e-commerce application experiences frequent latency spikes during peak hours. This Skill can help diagnose if GC pauses are the cause and guide the selection of a low-latency collector like ZGC, along with appropriate tuning parameters.

Quick Start

Use the JVM Performance Optimization skill to analyze GC logs and suggest tuning parameters for a G1 GC collector.

Frequently Asked Questions about JVM Performance Optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I tune JVM garbage collection to reduce latency spikes in a high-traffic Java application?

To tune JVM garbage collection and reduce latency spikes, analyze your GC logs to identify pause times, then select a low-latency collector like ZGC and adjust heap parameters. This Skill guides configuring appropriate GC algorithms based on your application's specific throughput and latency requirements.

What's the best way to profile CPU hotspots and memory leaks in a Java application?

The best way to profile CPU hotspots and memory leaks is to utilize tools like JFR, JMC, and async-profiler. This Skill provides techniques to diagnose these performance bottlenecks and identify resource utilization issues within your Java applications.

How do I optimize JVM memory management for heap and metaspace settings?

To optimize JVM memory management, you need to adjust heap, young generation, and metaspace settings according to your application's workload. This Skill offers strategies to optimize these memory areas to improve overall resource utilization and application performance.

When should I switch from a Parallel garbage collector to G1 or Shenandoah?

You should switch from a Parallel garbage collector to G1 or Shenandoah when your application requires lower pause times and handles larger heap sizes. This Skill helps select the right GC algorithm by comparing Serial, Parallel, G1, ZGC, and Shenandoah based on your needs.

Do I need to understand JVM internals to use advanced performance tuning techniques?

Yes, effective performance tuning requires an understanding of JVM internals, GC algorithms, and performance analysis tools. This Skill addresses performance bottlenecks through advanced garbage collection tuning and profiling techniques that rely on this foundational knowledge.