container-awarenesslisted
Install: claude install-skill robsonkades/agent-skills
# Container Awareness
## Purpose
Decide whether the JVM's automatic sizing inside this container is the sizing you
actually want. HotSpot's `UseContainerSupport` — on by default since JDK 10 on supported
Linux builds — incorporates cgroup memory and CPU constraints into ergonomics, using
version-specific detection. It does not make the resulting heap, GC thread
count or JIT thread count right for the workload.
The failure this prevents is the confidently wrong container diagnosis: a pod killed for
non-heap charges while the heap sat at 70%, diagnosed without reconciling memory views;
or a detected CPU count inferred from the default `ActiveProcessorCount=-1` sentinel.
## Workflow
This is Linux HotSpot guidance, with JDK 17–25 as the main command baseline and a JDK 26
heap-default note in the reference. Inspect the runtime image's vendor/update, launch flags,
deployment resources and kernel/cgroup version; a build toolchain alone does not identify
production ergonomics. Do not upgrade the runtime to match these examples.
1. **Establish what the target JVM detected, from inside its container.** A fresh
`java -XshowSettings:system` is a probe, not proof of the live JVM's settings: match binary,
options and cgroup, and prefer in-process `availableProcessors()` plus live flags.
Use `-Xlog:os+container=trace` for the raw
cgroup reads, `jcmd <pid> VM.flags -all` for ergonomically resolved flags. See
`references/reading-the-container.md`.
2. **Confirm the cgroup