991 |
991 |
992 // Record the fact that "bytes" bytes allocated in a region. |
992 // Record the fact that "bytes" bytes allocated in a region. |
993 void record_before_bytes(size_t bytes); |
993 void record_before_bytes(size_t bytes); |
994 void record_after_bytes(size_t bytes); |
994 void record_after_bytes(size_t bytes); |
995 |
995 |
996 // Returns "true" if this is a good time to do a collection pause. |
|
997 // The "word_size" argument, if non-zero, indicates the size of an |
|
998 // allocation request that is prompting this query. |
|
999 virtual bool should_do_collection_pause(size_t word_size) = 0; |
|
1000 |
|
1001 // Choose a new collection set. Marks the chosen regions as being |
996 // Choose a new collection set. Marks the chosen regions as being |
1002 // "in_collection_set", and links them together. The head and number of |
997 // "in_collection_set", and links them together. The head and number of |
1003 // the collection set are available via access methods. |
998 // the collection set are available via access methods. |
1004 virtual void choose_collection_set(double target_pause_time_ms) = 0; |
999 virtual void choose_collection_set(double target_pause_time_ms) = 0; |
1005 |
1000 |
1114 _short_lived_surv_rate_group->finished_recalculating_age_indexes(); |
1109 _short_lived_surv_rate_group->finished_recalculating_age_indexes(); |
1115 } |
1110 } |
1116 // do that for any other surv rate groups |
1111 // do that for any other surv rate groups |
1117 } |
1112 } |
1118 |
1113 |
1119 bool should_add_next_region_to_young_list(); |
1114 bool is_young_list_full() { |
|
1115 size_t young_list_length = _g1->young_list()->length(); |
|
1116 size_t young_list_max_length = _young_list_target_length; |
|
1117 if (G1FixedEdenSize) { |
|
1118 young_list_max_length -= _max_survivor_regions; |
|
1119 } |
|
1120 |
|
1121 return young_list_length >= young_list_max_length; |
|
1122 } |
|
1123 void update_region_num(bool young); |
1120 |
1124 |
1121 bool in_young_gc_mode() { |
1125 bool in_young_gc_mode() { |
1122 return _in_young_gc_mode; |
1126 return _in_young_gc_mode; |
1123 } |
1127 } |
1124 void set_in_young_gc_mode(bool in_young_gc_mode) { |
1128 void set_in_young_gc_mode(bool in_young_gc_mode) { |
1268 public: |
1272 public: |
1269 G1CollectorPolicy_BestRegionsFirst() { |
1273 G1CollectorPolicy_BestRegionsFirst() { |
1270 _collectionSetChooser = new CollectionSetChooser(); |
1274 _collectionSetChooser = new CollectionSetChooser(); |
1271 } |
1275 } |
1272 void record_collection_pause_end(); |
1276 void record_collection_pause_end(); |
1273 bool should_do_collection_pause(size_t word_size); |
|
1274 // This is not needed any more, after the CSet choosing code was |
1277 // This is not needed any more, after the CSet choosing code was |
1275 // changed to use the pause prediction work. But let's leave the |
1278 // changed to use the pause prediction work. But let's leave the |
1276 // hook in just in case. |
1279 // hook in just in case. |
1277 void note_change_in_marked_bytes(HeapRegion* r) { } |
1280 void note_change_in_marked_bytes(HeapRegion* r) { } |
1278 #ifndef PRODUCT |
1281 #ifndef PRODUCT |