< prev index next >

src/share/vm/gc/g1/g1CollectorPolicy.cpp

Print this page
rev 9312 : imported patch 8136678-implement-adaptive-sizing-algorithm-for-IHOP


1228     ergo_verbose2(ErgoTiming,
1229                   "adjust concurrent refinement thresholds",
1230                   ergo_format_reason("Scanning the HCC expected to take longer than Update RS time goal")
1231                   ergo_format_ms("Update RS time goal")
1232                   ergo_format_ms("Scan HCC time"),
1233                   update_rs_time_goal_ms,
1234                   scan_hcc_time_ms);
1235 
1236     update_rs_time_goal_ms = 0;
1237   } else {
1238     update_rs_time_goal_ms -= scan_hcc_time_ms;
1239   }
1240   adjust_concurrent_refinement(average_time_ms(G1GCPhaseTimes::UpdateRS) - scan_hcc_time_ms,
1241                                phase_times()->sum_thread_work_items(G1GCPhaseTimes::UpdateRS),
1242                                update_rs_time_goal_ms);
1243 
1244   _collectionSetChooser->verify();
1245 }
1246 
1247 G1IHOPControl* G1CollectorPolicy::create_ihop_control() const {
















1248   return new G1StaticIHOPControl(InitiatingHeapOccupancyPercent,
1249                                  G1CollectedHeap::heap()->max_capacity());

1250 }
1251 
1252 void G1CollectorPolicy::update_ihop_statistics(double marking_time,
1253                                                double mutator_time_s,
1254                                                size_t mutator_alloc_bytes,
1255                                                size_t young_gen_size) {
1256   bool report = false;
1257 
1258   // To avoid using really small times that may be caused by e.g. back-to-back gcs
1259   // we filter them out.
1260   double const min_valid_time = 1e-6;
1261 
1262   if (marking_time > min_valid_time) {
1263     _ihop_control->update_time_to_mixed(marking_time);
1264     report = true;
1265   }
1266 
1267   // As an approximation for the young gc promotion rates during marking we use
1268   // all of them. In many applications there are only a few if any young gcs during
1269   // marking, which makes any prediction useless. This increases the accuracy of the




1228     ergo_verbose2(ErgoTiming,
1229                   "adjust concurrent refinement thresholds",
1230                   ergo_format_reason("Scanning the HCC expected to take longer than Update RS time goal")
1231                   ergo_format_ms("Update RS time goal")
1232                   ergo_format_ms("Scan HCC time"),
1233                   update_rs_time_goal_ms,
1234                   scan_hcc_time_ms);
1235 
1236     update_rs_time_goal_ms = 0;
1237   } else {
1238     update_rs_time_goal_ms -= scan_hcc_time_ms;
1239   }
1240   adjust_concurrent_refinement(average_time_ms(G1GCPhaseTimes::UpdateRS) - scan_hcc_time_ms,
1241                                phase_times()->sum_thread_work_items(G1GCPhaseTimes::UpdateRS),
1242                                update_rs_time_goal_ms);
1243 
1244   _collectionSetChooser->verify();
1245 }
1246 
1247 G1IHOPControl* G1CollectorPolicy::create_ihop_control() const {
1248   if (G1UseAdaptiveIHOP) {
1249     // The target occupancy is the total heap occupancy we want to hit. First, we
1250     // want to avoid eating into the reserve intended for young GC (to avoid unnecessary
1251     // throughput loss). Additionally G1 is free to not clean out up to
1252     // G1HeapWastePercent of heap, that space also cannot be used for allocation
1253     // while marking.
1254     size_t safe_heap_percentage = (size_t) (G1ReservePercent + G1HeapWastePercent);
1255     size_t target_occupancy = 0;
1256 
1257     if (safe_heap_percentage < 100) {
1258       target_occupancy = G1CollectedHeap::heap()->max_capacity() * (100.0 - safe_heap_percentage) / 100.0;
1259     }
1260     return new G1AdaptiveIHOPControl(InitiatingHeapOccupancyPercent,
1261                                      target_occupancy,
1262                                      &_predictor);
1263   } else {
1264     return new G1StaticIHOPControl(InitiatingHeapOccupancyPercent,
1265                                    G1CollectedHeap::heap()->max_capacity());
1266   }
1267 }
1268 
1269 void G1CollectorPolicy::update_ihop_statistics(double marking_time,
1270                                                double mutator_time_s,
1271                                                size_t mutator_alloc_bytes,
1272                                                size_t young_gen_size) {
1273   bool report = false;
1274 
1275   // To avoid using really small times that may be caused by e.g. back-to-back gcs
1276   // we filter them out.
1277   double const min_valid_time = 1e-6;
1278 
1279   if (marking_time > min_valid_time) {
1280     _ihop_control->update_time_to_mixed(marking_time);
1281     report = true;
1282   }
1283 
1284   // As an approximation for the young gc promotion rates during marking we use
1285   // all of them. In many applications there are only a few if any young gcs during
1286   // marking, which makes any prediction useless. This increases the accuracy of the


< prev index next >