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]>
20 lines
780 B
Java
20 lines
780 B
Java
package com.ankurm.flagsdemo;
|
|
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
|
/**
|
|
* Companion app for "JVM Flags for Spring Boot in Containers (JDK 25/27)" on ankurm.com.
|
|
* See docs/output/*.txt for the captured runs this post quotes from, and
|
|
* {@link JvmDiagnosticsController} for the live /internal/jvm-flags endpoint
|
|
* used to inspect what the JVM actually resolved its memory/GC flags to
|
|
* inside a running container. Delete that endpoint before shipping this to
|
|
* a real service — it exists for this demo only.
|
|
*/
|
|
@SpringBootApplication
|
|
public class FlagsDemoApplication {
|
|
public static void main(String[] args) {
|
|
SpringApplication.run(FlagsDemoApplication.class, args);
|
|
}
|
|
}
|