Files
zgc-jdk25-benchmarks/flags/docs/output/03-activeprocessorcount-lie.txt
T
asmhatreandClaude Sonnet 5 2f88734f5d Add flags: production JVM flag cheat sheet for Spring Boot on JDK 25/27
MaxRAMPercentage vs a hardcoded -Xmx, -XX:-UseContainerSupport, the
ActiveProcessorCount lie, and which diagnostic flags are worth leaving
on in prod, verified in real Docker containers on JDK 25 and JDK 27.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-10-01 04:34:04 +00:00

14 lines
1.2 KiB
Plaintext

$ docker run --rm --cpus=1 --memory=1g --entrypoint java flags-demo:jdk27 -XX:+PrintFlagsFinal -version | grep -E "ParallelGCThreads|ConcGCThreads|ActiveProcessorCount"
$ docker run --rm --cpus=1 --memory=1g --entrypoint java flags-demo:jdk27 -XX:ActiveProcessorCount=8 -XX:+PrintFlagsFinal -version | grep -E "ParallelGCThreads|ConcGCThreads|ActiveProcessorCount"
=== ActiveProcessorCount lying to the JVM: 1 real CPU, told there are 8 ===
--- JDK27, --cpus=1, no override (correct) ---
int ActiveProcessorCount = -1 {product} {default}
uint ConcGCThreads = 1 {product} {ergonomic}
uint ParallelGCThreads = 1 {product} {default}
--- JDK27, --cpus=1, -XX:ActiveProcessorCount=8 (lying) ---
int ActiveProcessorCount = 8 {product} {command line}
uint ConcGCThreads = 2 {product} {ergonomic}
uint ParallelGCThreads = 8 {product} {default}