GC Flags

Prints all available GC flags:


Don’t JIT huge methods: 

Methods that have more than 2500 lines are considered are huge method.

Impact: Long GC Pauses


CMS Steps:

  1. STW Initial Mark
  2. Concurrent Mark
  3. Concurrent Preclean
  4. STW Remark
  5. Concurrent Sweep
  6. Concurrent Reset

CMS Flags:


Default on: -XX:+CMSParallelRemarkEnabled

Default on: -XX:+UseParNewGC

Default on: -XX:+CMSConcurrentMTEnabled




(< 1.8) -XX:+CMSPermGenSweepingEnabled

-XX:+ExplicitGCInvokesConcurrent or  -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses

Trigger minor collection before Remark Phase in CMS:(off by default)

Impact is Remark phase might be longer. Remember Remark phase is Stop The World.


Ref: http://blog.sokolenko.me/2014/11/javavm-options-production.html