← Recipes

Print JVM Ergonomics

Show what the JVM selected at startup so support and tuning conversations start with facts.

Flags

-XX:+PrintCommandLineFlags-XshowSettings:vm

-XX:+PrintCommandLineFlags prints important command-line and ergonomically selected VM flags. -XshowSettings:vm prints VM settings such as estimated max heap and VM mode.

Flag details

-XX:+PrintCommandLineFlags
Prints selected VM flags at startup, including flags supplied by the user and important ergonomic choices made by the JVM.
-XshowSettings:vm
Prints VM settings such as estimated maximum heap, VM name, and related runtime information before the application starts.

When to use it

Use this in support scripts, CI smoke tests, container debugging, and migration checks to confirm heap sizing, selected collector, and VM interpretation of the launch environment.

Java version support

-XX:+PrintCommandLineFlags and -XshowSettings:vm are diagnostic startup options available on modern HotSpot JVMs. They are safe support tools for checking the JVM's selected ergonomics before deeper tuning.

Related JEPs

Examples

java -XX:+PrintCommandLineFlags -XshowSettings:vm \
  -jar app.jar

Use this in a real launch command when you want startup logs to capture JVM decisions.

java -XX:+PrintCommandLineFlags -version

Use this quick check to inspect defaults for a JDK installation without starting the app.

Verify

Save the startup output with application logs so later incidents can be tied to the exact VM configuration.