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]>
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
$ 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}
|
||||
Reference in New Issue
Block a user