-
Notifications
You must be signed in to change notification settings - Fork 781
Fix exception "committed argument cannot be less than 0" #22150
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
Fix exception "committed argument cannot be less than 0" #22150
Conversation
b42da77 to
343f200
Compare
343f200 to
345cfcf
Compare
|
I have updated line to avoid the original logic(before PR #17107) change. For freeRegions >= _edenRegionCount case, keep maxEdenChange = 0 |
I have a feeling it's ok to have maxEdenChange negative. Otherwise we may allow eden to stay unchanged (because maxEdenChange was left 0) in cases it must be contracted (since _edenRegionCount is less than freeRegions). You have to test this more.... |
329f56e to
fe92579
Compare
|
Please correct the spelling of "previous" in the description and the commit message. |
1992225 to
0637fab
Compare
| } | ||
|
|
||
| /* Eden will be stealing free regions from the entire heap, without telling the heap to grow. | ||
| * Note: the eden sizing logic knows how much free memory is available in the heap, and knows to not grow too much. |
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.
Before we forget, but this part of the comment will not be true any more. We are changing the logic, we will not be stealing existing, but always growing. Let's remove it.
| _extensions->globalVLHGCStats._heapSizingData.edenRegionChange = OMR_MIN(maxHeapExpansionRegions, edenChangeWithSurvivorHeadroom + (intptr_t)(_edenRegionCount - freeRegions)); | ||
| } | ||
| } | ||
| /* Eden will inform the total heap resizing logic, that it needs to change total heap size in order to maintain same "tenure" size */ |
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.
This comment is too late now (since maxEdenChange calculation was move down) and even unrelated to maxEdenChange calculation. Move it up, just before the _heapSizingData.edenRegionChange calculation.
45eb219 to
dc057e3
Compare
95be277 to
fc4d337
Compare
|
@LinHu2016 is there any outlook for this being ready for review? |
|
This is close to ready. Reviewing some testing results, if they are ok, probably only cosmetic code changes before merging. |
| edenChangeWithSurvivorHeadroom = desiredEdenChangeSize + (intptr_t)ceil(((double)desiredEdenChangeSize * _edenSurvivalRateCopyForward)); | ||
| } else if (0 > desiredEdenChangeSize) { | ||
| /* If eden is shrinking, only factor adjusting in survivor regions for total heap resizing when eden is not very small. | ||
| * Factoring in survivor regions when eden is tiny can lead to some innacuracies, and reduce free non-eden regions, which may impact performance |
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.
we can remove this comment - we don't special treat very small eden
5d0c204 to
32cdc05
Compare
|
jenkins test extended.functional,extended.system,sanity.functional,sanity.openjdk,sanity.system amac,xLinux jdk21 |
4f190a2 to
0842584
Compare
0842584 to
5338b7c
Compare
|
Please update the commit message so sentences begin with a capital and end with a period (fix -> Fix, add -> Add). |
5338b7c to
c7f821c
Compare
|
The final sentence in the commit message is missing a period. |
574e1de to
d0061e7
Compare
| snapshot->_totalRegionEdenSize = allocateEdenTotal; | ||
| } | ||
|
|
||
| Assert_MM_true(snapshot->_totalRegionReservedSize >= (snapshot->_totalRegionEdenSize - allocateEdenTotal)); |
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 we put a similar assert somewhere at GC end path, instead? Just before this is triggered (hence after all resing logic is complete). This will be tested only if MXBean is activated, but should always be.
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.
Add
Assert_MM_true(((MM_GlobalAllocationManagerTarok *)_extensions->globalAllocationManager)->getFreeRegionCount() >= _edenRegionCount);
after calculateEdenSize(env); in heapReconfigured()
heapReconfigured() happens after Heap resize.
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 we do it even later, very close to when we trigger GC-end, so it covers other invocations of calculateEdenSize, too?
d0061e7 to
b7039c1
Compare
b7039c1 to
26753c8
Compare
|
jenkins test extended.functional,extended.system,sanity.functional,sanity.openjdk,sanity.system amac,xLinux jdk21 |
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>
26753c8 to
11f5a78
Compare
|
jenkins test extended.functional,extended.system,sanity.functional,sanity.openjdk,sanity.system aix,win jdk21 |


Previous PR #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