hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
changeset 28213 b0bf57cd1e9d
parent 27892 06a143c836ad
child 28483 76dc30e48a6e
equal deleted inserted replaced
28212:647b7d0efb88 28213:b0bf57cd1e9d
  1435   uint young_list_length = _g1->young_list()->length();
  1435   uint young_list_length = _g1->young_list()->length();
  1436   uint young_list_max_length = _young_list_max_length;
  1436   uint young_list_max_length = _young_list_max_length;
  1437   return young_list_length < young_list_max_length;
  1437   return young_list_length < young_list_max_length;
  1438 }
  1438 }
  1439 
  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() {
  1440 void G1CollectorPolicy::update_max_gc_locker_expansion() {
  1453   uint expansion_region_num = 0;
  1441   uint expansion_region_num = 0;
  1454   if (GCLockerEdenExpansionPercent > 0) {
  1442   if (GCLockerEdenExpansionPercent > 0) {
  1455     double perc = (double) GCLockerEdenExpansionPercent / 100.0;
  1443     double perc = (double) GCLockerEdenExpansionPercent / 100.0;
  1456     double expansion_region_num_d = perc * (double) _young_list_target_length;
  1444     double expansion_region_num_d = perc * (double) _young_list_target_length;
  1632   assert(!hr->in_collection_set(), "should not already be in the CSet");
  1620   assert(!hr->in_collection_set(), "should not already be in the CSet");
  1633   hr->set_in_collection_set(true);
  1621   hr->set_in_collection_set(true);
  1634   hr->set_next_in_collection_set(_collection_set);
  1622   hr->set_next_in_collection_set(_collection_set);
  1635   _collection_set = hr;
  1623   _collection_set = hr;
  1636   _collection_set_bytes_used_before += hr->used();
  1624   _collection_set_bytes_used_before += hr->used();
  1637   _g1->register_region_with_in_cset_fast_test(hr);
  1625   _g1->register_old_region_with_in_cset_fast_test(hr);
  1638   size_t rs_length = hr->rem_set()->occupied();
  1626   size_t rs_length = hr->rem_set()->occupied();
  1639   _recorded_rs_lengths += rs_length;
  1627   _recorded_rs_lengths += rs_length;
  1640   _old_cset_region_length += 1;
  1628   _old_cset_region_length += 1;
  1641 }
  1629 }
  1642 
  1630 
  1765 
  1753 
  1766   assert(!hr->in_collection_set(), "invariant");
  1754   assert(!hr->in_collection_set(), "invariant");
  1767   hr->set_in_collection_set(true);
  1755   hr->set_in_collection_set(true);
  1768   assert( hr->next_in_collection_set() == NULL, "invariant");
  1756   assert( hr->next_in_collection_set() == NULL, "invariant");
  1769 
  1757 
  1770   _g1->register_region_with_in_cset_fast_test(hr);
  1758   _g1->register_young_region_with_in_cset_fast_test(hr);
  1771 }
  1759 }
  1772 
  1760 
  1773 // Add the region at the RHS of the incremental cset
  1761 // Add the region at the RHS of the incremental cset
  1774 void G1CollectorPolicy::add_region_to_incremental_cset_rhs(HeapRegion* hr) {
  1762 void G1CollectorPolicy::add_region_to_incremental_cset_rhs(HeapRegion* hr) {
  1775   // We should only ever be appending survivors at the end of a pause
  1763   // We should only ever be appending survivors at the end of a pause