RFR (XS) 8242213: Shenandoah: remove unused ShenandoahHeuristics::_bytes_in_cset
Aleksey Shipilev
shade at redhat.com
Mon Apr 6 13:05:39 UTC 2020
RFE:
https://bugs.openjdk.java.net/browse/JDK-8242213
That field does not seem to be used for anything, yet we update it on critical path during cset
selection. We should ditch the field and all "uses" of it. Cursory examination seems to indicate it
was there since the initial integration.
Fix:
diff -r f30c66ecc928 src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp Mon Apr 06
14:46:40 2020 +0200
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp Mon Apr 06
15:04:29 2020 +0200
@@ -78,3 +78,2 @@
size_t cur_garbage = 0;
- _bytes_in_cset = 0;
@@ -92,3 +91,2 @@
cset->add_region(r);
- _bytes_in_cset += r->used();
cur_cset = new_cset;
diff -r f30c66ecc928 src/hotspot/share/gc/shenandoah/shenandoahHeuristics.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeuristics.cpp Mon Apr 06 14:46:40 2020 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeuristics.cpp Mon Apr 06 15:04:29 2020 +0200
@@ -48,3 +48,2 @@
_successful_cycles_in_a_row(0),
- _bytes_in_cset(0),
_cycle_start(os::elapsedTime()),
@@ -260,3 +259,3 @@
void ShenandoahHeuristics::record_allocation_failure_gc() {
- _bytes_in_cset = 0;
+ // Do nothing.
}
@@ -264,4 +263,2 @@
void ShenandoahHeuristics::record_requested_gc() {
- _bytes_in_cset = 0;
-
// Assume users call System.gc() when external state changes significantly,
diff -r f30c66ecc928 src/hotspot/share/gc/shenandoah/shenandoahHeuristics.hpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeuristics.hpp Mon Apr 06 14:46:40 2020 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeuristics.hpp Mon Apr 06 15:04:29 2020 +0200
@@ -84,4 +84,2 @@
- size_t _bytes_in_cset;
-
double _cycle_start;
Testing: hotspot_gc_shenandoah
--
Thanks,
-Aleksey
More information about the shenandoah-dev
mailing list