src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp
changeset 48889 216c2aabbf1f
parent 47647 64dba69fc528
child 48890 f9884e190f2b
equal deleted inserted replaced
48779:fdc2a952e8fe 48889:216c2aabbf1f
    77   size_t _sampled_rs_lengths;
    77   size_t _sampled_rs_lengths;
    78 public:
    78 public:
    79   G1YoungRemSetSamplingClosure(SuspendibleThreadSetJoiner* sts) :
    79   G1YoungRemSetSamplingClosure(SuspendibleThreadSetJoiner* sts) :
    80     HeapRegionClosure(), _sts(sts), _regions_visited(0), _sampled_rs_lengths(0) { }
    80     HeapRegionClosure(), _sts(sts), _regions_visited(0), _sampled_rs_lengths(0) { }
    81 
    81 
    82   virtual bool doHeapRegion(HeapRegion* r) {
    82   virtual bool do_heap_region(HeapRegion* r) {
    83     size_t rs_length = r->rem_set()->occupied();
    83     size_t rs_length = r->rem_set()->occupied();
    84     _sampled_rs_lengths += rs_length;
    84     _sampled_rs_lengths += rs_length;
    85 
    85 
    86     // Update the collection set policy information for this region
    86     // Update the collection set policy information for this region
    87     G1CollectedHeap::heap()->collection_set()->update_young_region_prediction(r, rs_length);
    87     G1CollectedHeap::heap()->collection_set()->update_young_region_prediction(r, rs_length);
   112     G1YoungRemSetSamplingClosure cl(&sts);
   112     G1YoungRemSetSamplingClosure cl(&sts);
   113 
   113 
   114     G1CollectionSet* g1cs = g1h->collection_set();
   114     G1CollectionSet* g1cs = g1h->collection_set();
   115     g1cs->iterate(&cl);
   115     g1cs->iterate(&cl);
   116 
   116 
   117     if (cl.complete()) {
   117     if (cl.is_complete()) {
   118       g1p->revise_young_list_target_length_if_necessary(cl.sampled_rs_lengths());
   118       g1p->revise_young_list_target_length_if_necessary(cl.sampled_rs_lengths());
   119     }
   119     }
   120   }
   120   }
   121 }
   121 }