< prev index next >

src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp

Print this page

        

*** 108,118 **** } else { log_info(gc)("Periodic GC disabled"); } while (!should_terminate()) { ! sample_young_list_rs_length(); if (os::supports_vtime()) { _vtime_accum = (os::elapsedVTime() - vtime_start); } else { _vtime_accum = 0.0; --- 108,118 ---- } else { log_info(gc)("Periodic GC disabled"); } while (!should_terminate()) { ! sample_young_list_rs_lengths(); if (os::supports_vtime()) { _vtime_accum = (os::elapsedVTime() - vtime_start); } else { _vtime_accum = 0.0;
*** 130,147 **** } class G1YoungRemSetSamplingClosure : public HeapRegionClosure { SuspendibleThreadSetJoiner* _sts; size_t _regions_visited; ! size_t _sampled_rs_length; public: G1YoungRemSetSamplingClosure(SuspendibleThreadSetJoiner* sts) : ! HeapRegionClosure(), _sts(sts), _regions_visited(0), _sampled_rs_length(0) { } virtual bool do_heap_region(HeapRegion* r) { size_t rs_length = r->rem_set()->occupied(); ! _sampled_rs_length += rs_length; // Update the collection set policy information for this region G1CollectedHeap::heap()->collection_set()->update_young_region_prediction(r, rs_length); _regions_visited++; --- 130,147 ---- } class G1YoungRemSetSamplingClosure : public HeapRegionClosure { SuspendibleThreadSetJoiner* _sts; size_t _regions_visited; ! size_t _sampled_rs_lengths; public: G1YoungRemSetSamplingClosure(SuspendibleThreadSetJoiner* sts) : ! HeapRegionClosure(), _sts(sts), _regions_visited(0), _sampled_rs_lengths(0) { } virtual bool do_heap_region(HeapRegion* r) { size_t rs_length = r->rem_set()->occupied(); ! _sampled_rs_lengths += rs_length; // Update the collection set policy information for this region G1CollectedHeap::heap()->collection_set()->update_young_region_prediction(r, rs_length); _regions_visited++;
*** 156,169 **** _regions_visited = 0; } return false; } ! size_t sampled_rs_length() const { return _sampled_rs_length; } }; ! void G1YoungRemSetSamplingThread::sample_young_list_rs_length() { SuspendibleThreadSetJoiner sts; G1CollectedHeap* g1h = G1CollectedHeap::heap(); G1Policy* policy = g1h->policy(); if (policy->use_adaptive_young_list_length()) { --- 156,169 ---- _regions_visited = 0; } return false; } ! size_t sampled_rs_lengths() const { return _sampled_rs_lengths; } }; ! void G1YoungRemSetSamplingThread::sample_young_list_rs_lengths() { SuspendibleThreadSetJoiner sts; G1CollectedHeap* g1h = G1CollectedHeap::heap(); G1Policy* policy = g1h->policy(); if (policy->use_adaptive_young_list_length()) {
*** 171,179 **** G1CollectionSet* g1cs = g1h->collection_set(); g1cs->iterate(&cl); if (cl.is_complete()) { ! policy->revise_young_list_target_length_if_necessary(cl.sampled_rs_length()); } } } --- 171,179 ---- G1CollectionSet* g1cs = g1h->collection_set(); g1cs->iterate(&cl); if (cl.is_complete()) { ! policy->revise_young_list_target_length_if_necessary(cl.sampled_rs_lengths()); } } }
< prev index next >