IBM JVM WebSphere Application Server what is the effect of -XX:+UseG1GC? Does -Xgcpolicy:gencon supersede?

1.2k views Asked by At

As per IBM link (https://www.ibm.com/support/knowledgecenter/SSYKE2_8.0.0/openj9/xgcpolicy/index.html), the gc policy can be specified by setting by -Xgcpolicy. Default gcpolicy is gencon (-Xgcpolicy:gencon). WAS is 9.0 and JVM is IBM J9 (Java version 1.8). Next, from the below link of IBM it seems that the setting of the gc algorithm is also possible using flag -XX, like in other JVM. E.g: -XX:+UseG1GC can work. https://www.ibm.com/support/knowledgecenter/en/SS3KLZ/com.ibm.java.diagnostics.visualizer.doc/verbosegc.html

My intention is to apply the gc behavior like of UseG1GC. The heap size is -Xms16G to -Xmx20G. So, I wish to go for Garbase First and concurrent that is UseG1GC. The -Xgcpolicy:gencon also does somewhat similar but it cause the "stop the world". When gc is running the application gets suspension. Little confused that even if I set the -XX:+UseG1GC, will it follow and be effective to UseG1GC behavior or it will follow the mechanism of -Xgcpolicy:gencon? Or the gcpolicy and gc algorithm are two different things?

1

There are 1 answers

0
Aleks On BEST ANSWER

There is no effect of using -XX:+UseG1GC on IBM JVM. It will just be silently swallowed. The JVM will default to Gencon GC policy.

You can verify that by running -verbose:gc, what will reported GC policy being used.

The closest IBM's GC policy to Hotspot's G1GC is Balanced one, the main distinguishing characteristics being they are region based (unlike Gencon that has two distinct ares of heap for old and new objects).

As far as concurrency, all 3 (G1GC, Balanced, Gencon) are similar: global GCs are mostly concurrent and partial/local GCs are STW (Stop-The-World).

Reasons to use region based GC policy are to reduce worst case pause time. They are capable of doing some global type operations incrementally in partial GCs. Most notably, they can incrementally de-fragment heap, unlike Gencon, that it does in global GC via optional STW compact operation. Most of applications will not require such global compact, hence Gencon is default. But, if long pauses due to global compaction are observed in Gencon run, Balanced should be tried. Balanced GC will however slightly compromise the application throughput.