RFR: Passive heuristics should consistently process refs and unload classes
Aleksey Shipilev
shade at redhat.com
Tue May 30 07:59:50 UTC 2017
We have copied the random block from Aggressive policy to Passive one. The goal
for random selection in Aggressive is to exercise all paths. For Passive, we are
better off being consistent:
$ hg diff
diff -r 1d44a55dc2c9 src/share/vm/gc/shenandoah/shenandoahCollectorPolicy.cpp
--- a/src/share/vm/gc/shenandoah/shenandoahCollectorPolicy.cpp Tue May 30
09:45:47 2017 +0200
+++ b/src/share/vm/gc/shenandoah/shenandoahCollectorPolicy.cpp Tue May 30
09:56:58 2017 +0200
@@ -431,14 +431,14 @@
}
virtual bool process_references() {
- // Randomly process refs with 50% chance.
- return (os::random() & 1) == 1;
+ // Always process references.
+ return true;
}
virtual bool unload_classes() {
if (ShenandoahUnloadClassesFrequency == 0) return false;
- // Randomly unload classes with 50% chance.
- return (os::random() & 1) == 1;
+ // Always unload classes.
+ return true;
}
};
Testing: hotspot_gc_shenandoah
Thanks,
-Aleksey
More information about the shenandoah-dev
mailing list