1171 return (uint) result;
1172 }
1173
1174 uint G1Policy::calc_max_old_cset_length() const {
1175 // The max old CSet region bound is based on the threshold expressed
1176 // as a percentage of the heap size. I.e., it should bound the
1177 // number of old regions added to the CSet irrespective of how many
1178 // of them are available.
1179
1180 const G1CollectedHeap* g1h = G1CollectedHeap::heap();
1181 const size_t region_num = g1h->num_regions();
1182 const size_t perc = (size_t) G1OldCSetRegionThresholdPercent;
1183 size_t result = region_num * perc / 100;
1184 // emulate ceiling
1185 if (100 * result < region_num * perc) {
1186 result += 1;
1187 }
1188 return (uint) result;
1189 }
1190
1191 void G1Policy::finalize_collection_set(double target_pause_time_ms, G1SurvivorRegions* survivor) {
1192 double time_remaining_ms = _collection_set->finalize_young_part(target_pause_time_ms, survivor);
1193 _collection_set->finalize_old_part(time_remaining_ms);
1194 }
1195
1196 void G1Policy::transfer_survivors_to_cset(const G1SurvivorRegions* survivors) {
1197
1198 // Add survivor regions to SurvRateGroup.
1199 note_start_adding_survivor_regions();
1200 finished_recalculating_age_indexes(true /* is_survivors */);
1201
1202 HeapRegion* last = NULL;
1203 for (GrowableArrayIterator<HeapRegion*> it = survivors->regions()->begin();
1204 it != survivors->regions()->end();
1205 ++it) {
1206 HeapRegion* curr = *it;
1207 set_region_survivor(curr);
1208
1209 // The region is a non-empty survivor so let's add it to
1210 // the incremental collection set for the next evacuation
1211 // pause.
1212 _collection_set->add_survivor_regions(curr);
1213
|
1171 return (uint) result;
1172 }
1173
1174 uint G1Policy::calc_max_old_cset_length() const {
1175 // The max old CSet region bound is based on the threshold expressed
1176 // as a percentage of the heap size. I.e., it should bound the
1177 // number of old regions added to the CSet irrespective of how many
1178 // of them are available.
1179
1180 const G1CollectedHeap* g1h = G1CollectedHeap::heap();
1181 const size_t region_num = g1h->num_regions();
1182 const size_t perc = (size_t) G1OldCSetRegionThresholdPercent;
1183 size_t result = region_num * perc / 100;
1184 // emulate ceiling
1185 if (100 * result < region_num * perc) {
1186 result += 1;
1187 }
1188 return (uint) result;
1189 }
1190
1191 uint G1Policy::finalize_collection_set(double target_pause_time_ms, G1SurvivorRegions* survivor) {
1192 double time_remaining_ms = _collection_set->finalize_young_part(target_pause_time_ms, survivor);
1193 _collection_set->finalize_old_part(time_remaining_ms);
1194
1195 return _collection_set->region_length();
1196 }
1197
1198 void G1Policy::transfer_survivors_to_cset(const G1SurvivorRegions* survivors) {
1199
1200 // Add survivor regions to SurvRateGroup.
1201 note_start_adding_survivor_regions();
1202 finished_recalculating_age_indexes(true /* is_survivors */);
1203
1204 HeapRegion* last = NULL;
1205 for (GrowableArrayIterator<HeapRegion*> it = survivors->regions()->begin();
1206 it != survivors->regions()->end();
1207 ++it) {
1208 HeapRegion* curr = *it;
1209 set_region_survivor(curr);
1210
1211 // The region is a non-empty survivor so let's add it to
1212 // the incremental collection set for the next evacuation
1213 // pause.
1214 _collection_set->add_survivor_regions(curr);
1215
|