Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8293861 G1: Disable preventive GCs by default
  3. JDK-8293863

Release Note: G1: Disable Preventive GCs by Default

    XMLWordPrintable

Details

    • gc

    Description

      In JDK 17, G1 added "preventive" garbage collections (GCs). These are speculative garbage collections, with the goal of avoiding costly evacuation failures due to allocation bursts when the heap is almost full.

      However, these speculative collections have the consequence of additional garbage collection work, as object aging is based on number of GCs with additional GCs causing premature promotion into the old generation, which leads to more data in the old generation, and more garbage collection work to remove these objects. This has been compounded by the current prediction to trigger preventive garbage collections being very conservative; which means these garbage collections are often triggered unnecessarily.

      In the majority of cases this feature is a net loss, and as evacuation failures are now handled more quickly, there is no longer any reason for this feature and it has been disabled by default, it may be re-enabled by `-XX:+UnlockDiagnosticVMOptions -XX:+G1UsePreventiveGC`.

      Attachments

        Activity

          People

            tschatzl Thomas Schatzl
            tschatzl Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: