0

Is there a way I can find GC type (parallel or CMS or G1 ) from jnconsole or jvisualvm? In my case, I see below related info:

Garbage Collector : Name='PS MarkSweep'....
Garbage Collector : Name='PS Scavenge'....

When I use the command -XX: +PrintCommandLineFlags it displays -XX:+UseParallelGC, so it confirms its parallel GC collector(though I though its CMS because of name PS MarkSweep in jconsole/jvisualvm) .

What will be the GC collector values for CMS and G1?

4444
  • 3,541
  • 10
  • 32
  • 43
emilly
  • 10,060
  • 33
  • 97
  • 172

1 Answers1

2

Parallel Garbage collector: -XX:+UseParallelGC (jvm option to use this collector, though this is default as of java 8)

Under jconsole/jvisualvm

Name = 'PS Scavenge', ... for (Minor Collection)
Garbage collector: 
Name = 'PS MarkSweep', for (Major Collection)

CMS Garbage collector: -XX:+UseParNewGC (jvm option to use this collector)

Under jconsole/jvisualvm

Name = 'ParNew', ... for (Minor Collection)
Garbage collector: 
Name = 'MarkSweepCompact', for (Major Collection)

G1 Garbage collector: -XX:+UseG1GC (jvm option to use this collector)

Under jconsole/jvisualvm

Name = 'G1 Young Generation', ... for (Minor Collection)
Garbage collector: 
Name = 'G1 Old Generation', for (Major Collection)

Without jconsole/jvisualvm:- you can juse -XX:+PrintCommandLineFlags jvm option to see GC type details on console

helvete
  • 2,455
  • 13
  • 33
  • 37
M Sach
  • 33,416
  • 76
  • 221
  • 314