You can use jmap -heap <jvm_pid>
to print a java heap summary. For example, the Intellij heap count is as follows if I ran jmap -heap 2592
:
Joining process ID 2592, please wait ...
The debugger is attached successfully.
server compiler detected.
JVM Version 25.101-b13
using parallel streams in the new generation. selection of objects.
Parallel Mark Scan GC
Mustache ...
As you can see in the output, the JVM instance that works with process id 2592 uses the CMS GC algorithm.
Also, if the algorithm was defined with these -XX:+Use*GC
flags, you can find this using jcmd <pid> VM.flags
. For instance:
$ jcmd 2715 VM.flags 2715: -XX:CICompilerCount=4 -XX:InitialHeapSize=268435456 -XX:MaxHeapSize=734003200 -XX:MaxNewSize=244318208 -XX:MinHeapDeltaBytes=524288 -XX:NewSize=89128960 -XX:OldSize=179306496 -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseFastUnorderedTimeStamps -XX:+UseParallelGC
As you can see, the VM uses Parallel GC.
source share