File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,14 @@ size_t G1HeapSizingPolicy::full_collection_resize_amount(bool& expand) {
217217 // Capacity, free and used after the GC counted as full regions to
218218 // include the waste in the following calculations.
219219 const size_t capacity_after_gc = _g1h->capacity ();
220- const size_t used_after_gc = capacity_after_gc - _g1h->unused_committed_regions_in_bytes ();
220+ const size_t used_after_gc = capacity_after_gc -
221+ _g1h->unused_committed_regions_in_bytes () -
222+ // Discount space used by current Eden to establish a
223+ // situation during Remark similar to at the end of full
224+ // GC where eden is empty. During Remark there can be an
225+ // arbitrary number of eden regions which would skew the
226+ // results.
227+ _g1h->eden_regions_count () * HeapRegion::GrainBytes;
221228
222229 size_t minimum_desired_capacity = target_heap_capacity (used_after_gc, MinHeapFreeRatio);
223230 size_t maximum_desired_capacity = target_heap_capacity (used_after_gc, MaxHeapFreeRatio);
You can’t perform that action at this time.
0 commit comments