Index of every page on this site: llms.txt
All skills
github avatar

/java-diagnostics

@f10fdb8 official
by githubgithub/awesome-copilot42k stars
5,426
Run it yourself

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.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/java-diagnostics

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencescontainers.md

≈424 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Containers

Memory sizing

  • The JVM is container-aware (cgroup limits) in JDK 10+ and 8u191+.
  • Heap defaults to 25% of the container limit. Use -XX:MaxRAMPercentage=75.0 (or lower, e.g. 50-70, if there is significant native/off-heap usage) instead of a fixed -Xmx, so the heap scales with the limit.
  • Leave headroom for metaspace, thread stacks, code cache, direct buffers; an OOM-kill (exit code 137, OOMKilled) with a healthy heap points to native memory growth (see native-memory).
  • Verify what the JVM sees: java -XX:+PrintFlagsFinal -version | grep -E 'MaxHeapSize|MaxRAMPercentage|ActiveProcessorCount' and jcmd <pid> VM.flags.

Attaching tools

  • jcmd/jstack must run inside the container (same PID namespace and user): docker exec -it <c> jcmd 1 Thread.print, kubectl exec <pod> -- jcmd 1 Thread.print. JRE-only images lack these tools.
  • Do not rebuild production images to add tools. Prefer an ephemeral debug container sharing the process namespace (kubectl debug -it <pod> --image=<jdk-image> --target=<container>), and only with explicit consent.
  • Output files are written by the target JVM inside the container's filesystem; copy them out with kubectl cp / docker cp, then delete them in the container. Mind ephemeral storage limits for heap dumps.
  • Tier 1/2/3 rules apply unchanged; production pods require explicit user instruction.

CPU

Few CPUs or CFS throttling cause latency and GC thread starvation. Check -XX:ActiveProcessorCount, throttling metrics (container_cpu_cfs_throttled_seconds_total), and thread-pool sizing.

Debugging

See the java-debugging skill for JDWP port mapping to 127.0.0.1.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts25d3 checks · Risk SAFE
  • Gen Agent Trust Hub25d

    This skill is a well-designed technical resource for JVM diagnostics. It provides clear, structured instructions for using industry-standard JDK tools and well-known third-party utilities. Security is a core component of the skill, which implements a permission tier system and provides explicit warnings and best practices for handling sensitive diagnostic data like heap dumps and flight recordings.

  • Socket25d

    No alerts

  • Snyk25d

    Risk: LOW · No issues

Signed by skilld at f10fdb8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated last month

README badge

README badge for github/awesome-copilot/java-diagnostics