-
Notifications
You must be signed in to change notification settings - Fork 781
Correct Balanced GC Eden size reporting for Mxbean #17107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct Balanced GC Eden size reporting for Mxbean #17107
Conversation
|
Ideally, I'd like to deal with these exceptional cases in core GC code rather than MXBean code. For example, getCurrentEdenSizeInBytes API should already handle the case when there is less free memory available than what desired Eden size is. There is already a lot of complexity to calculate desired size on core GC side, so adding this extra logic there is preferred - all that logic would be more centralized. Better than spill out a part of that complexity to MXBean. That said, we already have a couple of more spots that we exceptionally handle in MXBean (race where we can allocate more than desired, and GC-end not properly reporting age 0 regions). So I'm ok we handle this exceptional case here, too. But in a long run this MXBean code should be simpler... |
|
I agree that we should handle the exceptional case in core GC code, it would correct the reporting in verbose GC too. such as:
|
6a5d3c7 to
4d791a4
Compare
54a1226 to
993ea77
Compare
331eb74 to
39512dd
Compare
39512dd to
0613e61
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we expect (should we assert) freeRegions >= _edenRegionCount? if so, maxEdenChange could be unsigned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
freeRegions could be smaller than _edenRegionCount. in that case, new _edenRegionCount could be smaller than old edenRegionCount(new _edenRegionCount = freeRegions).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that this comment moved to common path it needs to be adjusted. At least remove the leading sentence 'The heap is fully expanded', possibly adjust the rest of it, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'/' could start at the line below
0613e61 to
a8250ff
Compare
After some GCs, the number of Free regions could be smaller than desired number of Eden regions, which causes the number of reserved Regions is smaller than 0(reserved Region size = Free Region size - Eden Region size), correct Eden region size = Free region size for the case. Signed-off-by: Lin Hu <linhu@ca.ibm.com>
a8250ff to
da25f84
Compare
|
jenkins test sanity win,aix jdk11 |
Pervious PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. fix case 1: maxHeapExpansionRegions could add on new eden region size but it could cause reserved eden regions are more than free reqions. fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Signed-off-by: lhu <linhu@ca.ibm.com>
Pervious PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. fix case 1: maxHeapExpansionRegions could add on new eden region size but it could cause reserved eden regions are more than free reqions. fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Signed-off-by: lhu <linhu@ca.ibm.com>
Pervious PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. fix case 1: maxHeapExpansionRegions could add on new eden region size but it could cause reserved eden regions are more than free reqions. fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Signed-off-by: lhu <linhu@ca.ibm.com>
Pervious PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. fix case 1: maxHeapExpansionRegions could add on new eden region size but it could cause reserved eden regions are more than free reqions. fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Signed-off-by: lhu <linhu@ca.ibm.com>
Pervious PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so add shrinkDueToNoEnoughFree to _extensions->globalVLHGCStats._heapSizingData.edenRegionChange for keeping free memory >= eden size after heap resize. but it could cause reserved eden regions are more than free reqions. fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Signed-off-by: lhu <linhu@ca.ibm.com>
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so add shrinkDueToNoEnoughFree to _extensions->globalVLHGCStats._heapSizingData.edenRegionChange for keeping free memory >= eden size after heap resize. fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Signed-off-by: lhu <linhu@ca.ibm.com>
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so add shrinkDueToNoEnoughFree to _extensions->globalVLHGCStats._heapSizingData.edenRegionChange for keeping free memory >= eden size after heap resize. fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Signed-off-by: lhu <linhu@ca.ibm.com>
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion check to confirm free size >= eden size. Signed-off-by: lhu <linhu@ca.ibm.com>
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion checks to confirm free size >= eden size. Signed-off-by: lhu <linhu@ca.ibm.com>
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion checks to confirm free size >= eden size. Signed-off-by: lhu <linhu@ca.ibm.com>
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion check to confirm free size >= eden size. Signed-off-by: lhu linhu@ca.ibm.com
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion check to confirm free size >= eden size. Signed-off-by: lhu linhu@ca.ibm.com
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion check to confirm free size >= eden size. Signed-off-by: lhu linhu@ca.ibm.com
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion check to confirm free size >= eden size. Signed-off-by: lhu linhu@ca.ibm.com
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion check to confirm free size >= eden size. Signed-off-by: lhu linhu@ca.ibm.com
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion check to confirm free size >= eden size. Signed-off-by: lhu linhu@ca.ibm.com
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion checks to confirm free size >= eden size. if the heap size change need to be adjusted due to enden size change and adjusted heap change size is 0 and _heapSizingData.edenRegionChange > 0 ( expending case), then need to set heap change size = edenRegionChange to avoid eden size is bigger than free size issue. Signed-off-by: lhu <linhu@ca.ibm.com>
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion checks to confirm free size >= eden size. if the heap size change need to be adjusted due to enden size change and adjusted heap change size is 0 and _heapSizingData.edenRegionChange > 0 ( expending case), then need to set heap change size = edenRegionChange to avoid eden size is bigger than free size issue. Signed-off-by: lhu <linhu@ca.ibm.com>
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion check to confirm free size >= eden size. Signed-off-by: lhu linhu@ca.ibm.com
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion check to confirm free size >= eden size. Signed-off-by: lhu linhu@ca.ibm.com
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion check to confirm free size >= eden size. Signed-off-by: lhu linhu@ca.ibm.com
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion check to confirm free size >= eden size. Signed-off-by: lhu linhu@ca.ibm.com
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion check to confirm free size >= eden size. Signed-off-by: lhu linhu@ca.ibm.com
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion check to confirm free size >= eden size. Signed-off-by: lhu linhu@ca.ibm.com
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion check to confirm free size >= eden size. Signed-off-by: lhu linhu@ca.ibm.com
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion checks to confirm free size >= eden size. if the heap size change need to be adjusted due to enden size change and adjusted heap change size is 0 and _heapSizingData.edenRegionChange > 0 ( expending case), then need to set heap change size = edenRegionChange to avoid eden size is bigger than free size issue. Signed-off-by: lhu <linhu@ca.ibm.com>
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion check to confirm free size >= eden size. Signed-off-by: lhu linhu@ca.ibm.com
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion checks to confirm free size >= eden size. if the heap size change need to be adjusted due to enden size change and adjusted heap change size is 0 and _heapSizingData.edenRegionChange > 0 ( expending case), then need to set heap change size = edenRegionChange to avoid eden size is bigger than free size issue. Signed-off-by: lhu <linhu@ca.ibm.com>
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion check to confirm free size >= eden size. Signed-off-by: lhu linhu@ca.ibm.com
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion checks to confirm free size >= eden size. Update to correct freeTenure at the beginning of PGC should count out free eden size(for most case, free eden would be closed to 0, but in some cases free eden is significant, it might confuse the heap resize algorithm). Signed-off-by: lhu <linhu@ca.ibm.com>
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion checks to confirm free size >= eden size. Update to correct freeTenure at the beginning of PGC should count out free eden size(for most case, free eden would be closed to 0, but in some cases free eden is significant, it might confuse the heap resize algorithm). Signed-off-by: lhu <linhu@ca.ibm.com>
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion checks to confirm free size >= eden size. Update to correct freeTenure at the beginning of PGC should count out free eden size(for most case, free eden would be closed to 0, but in some cases free eden is significant, it might confuse the heap resize algorithm). Signed-off-by: lhu <linhu@ca.ibm.com>
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion checks to confirm free size >= eden size. Update to correct freeTenure at the beginning of PGC should count out free eden size(for most case, free eden would be closed to 0, but in some cases free eden is significant, it might confuse the heap resize algorithm). Signed-off-by: lhu <linhu@ca.ibm.com>
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion checks to confirm free size >= eden size. Update to correct freeTenure at the beginning of PGC should count out free eden size(for most case, free eden would be closed to 0, but in some cases free eden is significant, it might confuse the heap resize algorithm). Signed-off-by: lhu <linhu@ca.ibm.com>
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion checks to confirm free size >= eden size. Update to correct freeTenure at the beginning of PGC should count out free eden size(for most case, free eden would be closed to 0, but in some cases free eden is significant, it might confuse the heap resize algorithm). Signed-off-by: lhu <linhu@ca.ibm.com>
Previous PR eclipse-openj9#17107 target to prevent exception "committed argument cannot be less than 0" for MemoryPool "balanced-reserved" during collecting memoryUsage at the end of GC(balanced GC only), but there are two special cases haven't been covered. Fix case 1: maxHeapExpansionRegions could add on maxEdenChange and use _extensions->globalVLHGCStats._heapSizingData.edenRegionChange to notify heap resize to adjust heap size to match eden change, but it did not consider the case which eden size is bigger than free memory, so update _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); for keeping free memory >= eden size after heap resize. Fix case 2: eden region can not be smaller than 1, when free region is 0 eden region size can be 0. Add Assertion checks to confirm free size >= eden size. Update to correct freeTenure at the beginning of PGC should count out free eden size(for most case, free eden would be closed to 0, but in some cases free eden is significant, it might confuse the heap resize algorithm). Signed-off-by: lhu <linhu@ca.ibm.com>
After some GCs, the number of Free regions could be smaller than desired number of Eden regions, which causes the number of reserved Regions is smaller than 0(reserved Region size = Free Region size - Eden Region size), correct Eden region size = Free region size for the case.
fix: #16413