emilly
emilly

Reputation: 10530

Determine Garbage collector type from jconsole/jvisualvm?

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?

Upvotes: 0

Views: 1111

Answers (1)

M Sach
M Sach

Reputation: 34424

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

Upvotes: 2

Related Questions