Skip to content

Commit 7e6ebde

Browse files
author
Man Cao
committedOct 15, 2019
8232232: G1RemSetSummary::_rs_threads_vtimes is not initialized to zero
Fix error in "Concurrent refinement threads times" in GC log and cleanup. Reviewed-by: tschatzl, kbarrett
1 parent db097ae commit 7e6ebde

File tree

3 files changed

+8
-19
lines changed

3 files changed

+8
-19
lines changed
 

‎src/hotspot/share/gc/g1/g1RemSet.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ G1RemSet::G1RemSet(G1CollectedHeap* g1h,
487487
G1CardTable* ct,
488488
G1HotCardCache* hot_card_cache) :
489489
_scan_state(new G1RemSetScanState()),
490-
_prev_period_summary(),
490+
_prev_period_summary(false),
491491
_g1h(g1h),
492492
_ct(ct),
493493
_g1p(_g1h->policy()),
@@ -1404,7 +1404,7 @@ void G1RemSet::print_periodic_summary_info(const char* header, uint period_count
14041404
if ((G1SummarizeRSetStatsPeriod > 0) && log_is_enabled(Trace, gc, remset) &&
14051405
(period_count % G1SummarizeRSetStatsPeriod == 0)) {
14061406

1407-
G1RemSetSummary current(this);
1407+
G1RemSetSummary current;
14081408
_prev_period_summary.subtract_from(&current);
14091409

14101410
Log(gc, remset) log;
@@ -1421,7 +1421,7 @@ void G1RemSet::print_summary_info() {
14211421
Log(gc, remset, exit) log;
14221422
if (log.is_trace()) {
14231423
log.trace(" Cumulative RS summary");
1424-
G1RemSetSummary current(this);
1424+
G1RemSetSummary current;
14251425
ResourceMark rm;
14261426
LogStream ls(log.trace());
14271427
current.print_on(&ls);

‎src/hotspot/share/gc/g1/g1RemSetSummary.cpp

+4-12
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ double G1RemSetSummary::rs_thread_vtime(uint thread) const {
8181
return _rs_threads_vtimes[thread];
8282
}
8383

84-
G1RemSetSummary::G1RemSetSummary() :
85-
_rem_set(NULL),
84+
G1RemSetSummary::G1RemSetSummary(bool should_update) :
8685
_total_mutator_refined_cards(0),
8786
_total_concurrent_refined_cards(0),
8887
_num_coarsenings(0),
@@ -91,17 +90,10 @@ G1RemSetSummary::G1RemSetSummary() :
9190
_sampling_thread_vtime(0.0f) {
9291

9392
memset(_rs_threads_vtimes, 0, sizeof(double) * _num_vtimes);
94-
}
9593

96-
G1RemSetSummary::G1RemSetSummary(G1RemSet* rem_set) :
97-
_rem_set(rem_set),
98-
_total_mutator_refined_cards(0),
99-
_total_concurrent_refined_cards(0),
100-
_num_coarsenings(0),
101-
_num_vtimes(G1ConcurrentRefine::max_num_threads()),
102-
_rs_threads_vtimes(NEW_C_HEAP_ARRAY(double, _num_vtimes, mtGC)),
103-
_sampling_thread_vtime(0.0f) {
104-
update();
94+
if (should_update) {
95+
update();
96+
}
10597
}
10698

10799
G1RemSetSummary::~G1RemSetSummary() {

‎src/hotspot/share/gc/g1/g1RemSetSummary.hpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ class G1RemSetSummary {
3636
private:
3737
friend class GetRSThreadVTimeClosure;
3838

39-
G1RemSet* _rem_set;
40-
4139
size_t _total_mutator_refined_cards;
4240
size_t _total_concurrent_refined_cards;
4341

@@ -57,8 +55,7 @@ class G1RemSetSummary {
5755
void update();
5856

5957
public:
60-
G1RemSetSummary();
61-
G1RemSetSummary(G1RemSet* remset);
58+
G1RemSetSummary(bool should_update = true);
6259

6360
~G1RemSetSummary();
6461

0 commit comments

Comments
 (0)
Please sign in to comment.