Skip to content

Commit

Permalink
8330670: Obsolete ScavengeBeforeFullGC
Browse files Browse the repository at this point in the history
Reviewed-by: stefank, tschatzl
  • Loading branch information
albertnetymk committed Apr 24, 2024
1 parent 174d626 commit 7bb59dc
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 24 deletions.
4 changes: 0 additions & 4 deletions src/hotspot/share/gc/parallel/psParallelCompact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1273,10 +1273,6 @@ bool PSParallelCompact::invoke(bool maximum_heap_compaction) {

IsGCActiveMark mark;

if (ScavengeBeforeFullGC) {
PSScavenge::invoke_no_policy();
}

const bool clear_all_soft_refs =
heap->soft_ref_policy()->should_clear_all_soft_refs();

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/serial/serialHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ void SerialHeap::do_collection(bool full,
IsGCActiveMark active_gc_mark;

bool complete = full && (max_generation == OldGen);
bool old_collects_young = complete && !ScavengeBeforeFullGC;
bool old_collects_young = complete;
bool do_young_collection = !old_collects_young && _young_gen->should_collect(full, size, is_tlab);

const PreGenGCValues pre_gc_values = get_pre_gc_values();
Expand Down
4 changes: 0 additions & 4 deletions src/hotspot/share/gc/shared/gcArguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ void GCArguments::initialize() {
MarkSweepAlwaysCompactCount = 1; // Move objects every gc.
}

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

if (GCTimeLimit == 100) {
// Turn off gc-overhead-limit-exceeded checks
FLAG_SET_DEFAULT(UseGCOverheadLimit, false);
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/share/gc/shared/gc_globals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,6 @@
"Never tenure objects in eden, may tenure on overflow " \
"(ParallelGC only)") \
\
product(bool, ScavengeBeforeFullGC, true, \
"Scavenge youngest generation before each full GC.") \
\
product(bool, ExplicitGCInvokesConcurrent, false, \
"A System.gc() request invokes a concurrent collection; " \
"(effective only when using concurrent collectors)") \
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/share/gc/z/zDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,7 @@ static bool should_preclean_young(GCCause::Cause cause) {
// catch that above and perform young gen pre-cleaning.
assert(!should_clear_soft_references(cause), "Clearing soft references without pre-cleaning young gen");

// Preclean young if implied by configuration
return ScavengeBeforeFullGC;
return false;
}

ZDriverMajor::ZDriverMajor()
Expand Down
10 changes: 1 addition & 9 deletions src/hotspot/share/runtime/arguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ static SpecialFlag const special_jvm_flags[] = {
{ "ParallelOldDeadWoodLimiterMean", JDK_Version::undefined(), JDK_Version::jdk(23), JDK_Version::jdk(24) },
{ "ParallelOldDeadWoodLimiterStdDev", JDK_Version::undefined(), JDK_Version::jdk(23), JDK_Version::jdk(24) },
{ "UseNeon", JDK_Version::undefined(), JDK_Version::jdk(23), JDK_Version::jdk(24) },
{ "ScavengeBeforeFullGC", JDK_Version::undefined(), JDK_Version::jdk(23), JDK_Version::jdk(24) },
#ifdef ASSERT
{ "DummyObsoleteTestFlag", JDK_Version::undefined(), JDK_Version::jdk(18), JDK_Version::undefined() },
#endif
Expand Down Expand Up @@ -1715,11 +1716,6 @@ jint Arguments::set_aggressive_heap_flags() {
return JNI_EINVAL;
}

// This appears to improve mutator locality
if (FLAG_SET_CMDLINE(ScavengeBeforeFullGC, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}

return JNI_OK;
}

Expand Down Expand Up @@ -2735,10 +2731,6 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m
if (FLAG_SET_CMDLINE(FullGCALot, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// disable scavenge before parallel mark-compact
if (FLAG_SET_CMDLINE(ScavengeBeforeFullGC, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
#endif
#if !INCLUDE_MANAGEMENT
} else if (match_option(option, "-XX:+ManagementServer")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* /test/lib
* @build jdk.test.whitebox.WhiteBox
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+IgnoreUnrecognizedVMOptions -XX:-ScavengeBeforeFullGC gc.gctests.WeakReference.weak006.weak006 -t 1
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+IgnoreUnrecognizedVMOptions gc.gctests.WeakReference.weak006.weak006 -t 1
*/

package gc.gctests.WeakReference.weak006;
Expand Down

1 comment on commit 7bb59dc

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.