BIRKEY CONSULTING

ABOUT  GITHUB  RSS  ARCHIVE  DONATE


03 Oct 2018

VM flags from running JVM

While I was doing some JVM GC analysis recently, I got curious about the vm flags that `java` command uses by default if you do not specify it when starting your JVM. Reading up JDK docs, I found jcmd is exactly what you need:

jcmd

That will list all jvm instances running on your system beginning with its pids, which you can pass into jcmd with options to print VM flags like this:

jcmd <pid> VM.flags

There are many options you can use other than `VM.flags`, which you can get a full list by:

jcmd <pid> help
Tags: jvm