Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8330670

Obsolete ScavengeBeforeFullGC

XMLWordPrintable

    • gc
    • b20

      This flag controls whether to initiate a young-gc cycle before starting a full-gc cycle.

      This flag is enable by default only for Parallel.

      ```
        if (!UseParallelGC && FLAG_IS_DEFAULT(ScavengeBeforeFullGC)) {
          FLAG_SET_DEFAULT(ScavengeBeforeFullGC, false);
        }
      ```

      Its manual is incorrect and the rational for keeping it on has become outdated.

      ```
      -XX:+ScavengeBeforeFullGC
          Enables GC of the young generation before each full GC. This option is enabled by default. It is recommended that you don't disable it, because scavenging the young generation before a full GC can reduce the number of objects reachable from the old generation space into the young generation space. To disable GC of the young generation before each full GC, specify the option -XX:-ScavengeBeforeFullGC.
      ```

      When Parallel full-gc is single-threaded, it can be beneficial to kick-off a fast young-gc to group live objects together to speed up full-gc. However, nowadays Parallel full-gc is multiple-threads, the cost of an extra young-gc cycle often outweigh its benefit.

            ayang Albert Yang
            ayang Albert Yang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: