diff --git a/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp b/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp index b51d0cdf84a..7d6cc9a41cb 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp @@ -254,13 +254,12 @@ uint64_t G1ConcurrentRefine::adjust_threads_wait_ms() const { } class G1ConcurrentRefine::RemSetSamplingClosure : public G1HeapRegionClosure { - G1CollectionSet* _cset; size_t _sampled_card_rs_length; size_t _sampled_code_root_rs_length; public: - explicit RemSetSamplingClosure(G1CollectionSet* cset) : - _cset(cset), _sampled_card_rs_length(0), _sampled_code_root_rs_length(0) {} + RemSetSamplingClosure() : + _sampled_card_rs_length(0), _sampled_code_root_rs_length(0) {} bool do_heap_region(G1HeapRegion* r) override { G1HeapRegionRemSet* rem_set = r->rem_set(); @@ -287,8 +286,8 @@ public: // gen size to keep pause time length goal. void G1ConcurrentRefine::adjust_young_list_target_length() { if (_policy->use_adaptive_young_list_length()) { + RemSetSamplingClosure cl; G1CollectionSet* cset = G1CollectedHeap::heap()->collection_set(); - RemSetSamplingClosure cl{cset}; cset->iterate(&cl); _policy->revise_young_list_target_length(cl.sampled_card_rs_length(), cl.sampled_code_root_rs_length()); }