Long mixed pauses when using G1

Solution Unverified - Updated

Environment

  • JBoss Enterprise Application Platform (EAP)
  • Java 8
    • G1

Issue

  • We use G1 gc and sometimes see long mixed collection pauses (10+ seconds). How can we reduce these mixed pause times?

Resolution

  • Increase G1MixedGCCountTarget so that eligible old gen regions are collected across a larger amount of mixed collections, reducing individual mixed pauses.
-XX:G1MixedGCCountTarget=16
  • Reduce G1OldCSetRegionThresholdPercent so fewer regions are collected in a mixed collection:
-XX:G1OldCSetRegionThresholdPercent=5
  • Increase G1MixedGCLiveThresholdPercent to limit and focus collections to old regions containing less live objects:
-XX:+UnlockExperimentalVMOptions -XX:G1MixedGCLiveThresholdPercent=85
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.