8232232: G1RemSetSummary::_rs_threads_vtimes is not initialized to zero
Summary: Fix error in "Concurrent refinement threads times" in GC log and cleanup.
Reviewed-by: tschatzl, kbarrett
--- a/src/hotspot/share/gc/g1/g1RemSet.cpp Wed Oct 16 16:54:56 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1RemSet.cpp Mon Oct 14 18:48:10 2019 -0700
@@ -487,7 +487,7 @@
G1CardTable* ct,
G1HotCardCache* hot_card_cache) :
_scan_state(new G1RemSetScanState()),
- _prev_period_summary(),
+ _prev_period_summary(false),
_g1h(g1h),
_ct(ct),
_g1p(_g1h->policy()),
@@ -1404,7 +1404,7 @@
if ((G1SummarizeRSetStatsPeriod > 0) && log_is_enabled(Trace, gc, remset) &&
(period_count % G1SummarizeRSetStatsPeriod == 0)) {
- G1RemSetSummary current(this);
+ G1RemSetSummary current;
_prev_period_summary.subtract_from(¤t);
Log(gc, remset) log;
@@ -1421,7 +1421,7 @@
Log(gc, remset, exit) log;
if (log.is_trace()) {
log.trace(" Cumulative RS summary");
- G1RemSetSummary current(this);
+ G1RemSetSummary current;
ResourceMark rm;
LogStream ls(log.trace());
current.print_on(&ls);
--- a/src/hotspot/share/gc/g1/g1RemSetSummary.cpp Wed Oct 16 16:54:56 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1RemSetSummary.cpp Mon Oct 14 18:48:10 2019 -0700
@@ -81,8 +81,7 @@
return _rs_threads_vtimes[thread];
}
-G1RemSetSummary::G1RemSetSummary() :
- _rem_set(NULL),
+G1RemSetSummary::G1RemSetSummary(bool should_update) :
_total_mutator_refined_cards(0),
_total_concurrent_refined_cards(0),
_num_coarsenings(0),
@@ -91,17 +90,10 @@
_sampling_thread_vtime(0.0f) {
memset(_rs_threads_vtimes, 0, sizeof(double) * _num_vtimes);
-}
-G1RemSetSummary::G1RemSetSummary(G1RemSet* rem_set) :
- _rem_set(rem_set),
- _total_mutator_refined_cards(0),
- _total_concurrent_refined_cards(0),
- _num_coarsenings(0),
- _num_vtimes(G1ConcurrentRefine::max_num_threads()),
- _rs_threads_vtimes(NEW_C_HEAP_ARRAY(double, _num_vtimes, mtGC)),
- _sampling_thread_vtime(0.0f) {
- update();
+ if (should_update) {
+ update();
+ }
}
G1RemSetSummary::~G1RemSetSummary() {
--- a/src/hotspot/share/gc/g1/g1RemSetSummary.hpp Wed Oct 16 16:54:56 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1RemSetSummary.hpp Mon Oct 14 18:48:10 2019 -0700
@@ -36,8 +36,6 @@
private:
friend class GetRSThreadVTimeClosure;
- G1RemSet* _rem_set;
-
size_t _total_mutator_refined_cards;
size_t _total_concurrent_refined_cards;
@@ -57,8 +55,7 @@
void update();
public:
- G1RemSetSummary();
- G1RemSetSummary(G1RemSet* remset);
+ G1RemSetSummary(bool should_update = true);
~G1RemSetSummary();