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.
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.
- csr for
-
JDK-8330671 Obsolete ScavengeBeforeFullGC
- Closed
- relates to
-
JDK-8331353 Test java/util/Base64/TestEncodingDecodingLength.java fails with OOME using ParallelGC after JDK-8330670
- Closed
-
JDK-8333227 Parallel: Regressions 1-6% in Compress-ParGC after JDK-8330670
- Closed
-
JDK-8295153 java/util/Base64/TestEncodingDecodingLength.java ran out of memory
- Closed
(1 links to)