< prev index next >

hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp

Print this page
rev 6911 : 8065305: Make it possible to extend the G1CollectorPolicy
Summary: Added a G1CollectorPolicyExt where it is possible to extend the class.
Reviewed-by: sjohanss, tschatzl


1408                   expand_bytes_via_pct, (double) G1ExpandByPercentOfAvailable);
1409 
1410     return expand_bytes;
1411   } else {
1412     return 0;
1413   }
1414 }
1415 
1416 void G1CollectorPolicy::print_tracing_info() const {
1417   _trace_gen0_time_data.print();
1418   _trace_gen1_time_data.print();
1419 }
1420 
1421 void G1CollectorPolicy::print_yg_surv_rate_info() const {
1422 #ifndef PRODUCT
1423   _short_lived_surv_rate_group->print_surv_rate_summary();
1424   // add this call for any other surv rate groups
1425 #endif // PRODUCT
1426 }
1427 












1428 uint G1CollectorPolicy::max_regions(int purpose) {
1429   switch (purpose) {
1430     case GCAllocForSurvived:
1431       return _max_survivor_regions;
1432     case GCAllocForTenured:
1433       return REGIONS_UNLIMITED;
1434     default:
1435       ShouldNotReachHere();
1436       return REGIONS_UNLIMITED;
1437   };
1438 }
1439 
1440 void G1CollectorPolicy::update_max_gc_locker_expansion() {
1441   uint expansion_region_num = 0;
1442   if (GCLockerEdenExpansionPercent > 0) {
1443     double perc = (double) GCLockerEdenExpansionPercent / 100.0;
1444     double expansion_region_num_d = perc * (double) _young_list_target_length;
1445     // We use ceiling so that if expansion_region_num_d is > 0.0 (but
1446     // less than 1.0) we'll get 1.
1447     expansion_region_num = (uint) ceil(expansion_region_num_d);




1408                   expand_bytes_via_pct, (double) G1ExpandByPercentOfAvailable);
1409 
1410     return expand_bytes;
1411   } else {
1412     return 0;
1413   }
1414 }
1415 
1416 void G1CollectorPolicy::print_tracing_info() const {
1417   _trace_gen0_time_data.print();
1418   _trace_gen1_time_data.print();
1419 }
1420 
1421 void G1CollectorPolicy::print_yg_surv_rate_info() const {
1422 #ifndef PRODUCT
1423   _short_lived_surv_rate_group->print_surv_rate_summary();
1424   // add this call for any other surv rate groups
1425 #endif // PRODUCT
1426 }
1427 
1428 bool G1CollectorPolicy::is_young_list_full() {
1429   uint young_list_length = _g1->young_list()->length();
1430   uint young_list_target_length = _young_list_target_length;
1431   return young_list_length >= young_list_target_length;
1432 }
1433 
1434 bool G1CollectorPolicy::can_expand_young_list() {
1435   uint young_list_length = _g1->young_list()->length();
1436   uint young_list_max_length = _young_list_max_length;
1437   return young_list_length < young_list_max_length;
1438 }
1439 
1440 uint G1CollectorPolicy::max_regions(int purpose) {
1441   switch (purpose) {
1442     case GCAllocForSurvived:
1443       return _max_survivor_regions;
1444     case GCAllocForTenured:
1445       return REGIONS_UNLIMITED;
1446     default:
1447       ShouldNotReachHere();
1448       return REGIONS_UNLIMITED;
1449   };
1450 }
1451 
1452 void G1CollectorPolicy::update_max_gc_locker_expansion() {
1453   uint expansion_region_num = 0;
1454   if (GCLockerEdenExpansionPercent > 0) {
1455     double perc = (double) GCLockerEdenExpansionPercent / 100.0;
1456     double expansion_region_num_d = perc * (double) _young_list_target_length;
1457     // We use ceiling so that if expansion_region_num_d is > 0.0 (but
1458     // less than 1.0) we'll get 1.
1459     expansion_region_num = (uint) ceil(expansion_region_num_d);


< prev index next >