[JVM] How to know about JVM defaults settings and supported flags

Each JVM implementation had a different set of default and choose default settings based on the environment it runs in. It's always good to know the default. Let's see how to get the default.

Using -XX:+PrintCommandLineFlags

This is the output on my laptop. The JVM choose Compressed Oops and parallel GC. PrinCommandLineFlags provides a compact out.

Viewing all JVM supported flags

To view all the flags and their values supported by a JVM, use -XX:+PrintFlagsFinal

It displays a long list of all the flags. Here is the output for JDK 1.8 running locally

JVMFlags

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.