Repository navigation
Fix overflow in Balanced expand - #13712
Merged
Merged
Conversation
amicic
force-pushed
the
overflow_expand
branch
from
October 15, 2021 13:57
0d1a320 to
2419682
Compare
Total heap resizing (based on GC overhead heuristics) may suggest to expand to a smaller value than current total heap size, leading to contraction (what might not be problem by itself). The bigger problem is that internally it's represented as a big (overflowed) unsigned integer and while arithmetic (+/- operators) will silently work (we will successfully contract), that's not the case for comparisons (<,> operators). If there was a large object alloc request and there is not free enough memory we may want to expand, but since this alloc size is likely to be less than the fake expand, it won't be able to trigger the real expand. Eventually, this may lead to failing to allocate and OOM condition. The fix is simply to prevent the overflow math and set the expansion value to 0, if calculated value is negative. Fixes: eclipse-openj9#13584 Signed-off-by: Aleksandar Micic <amicic@ca.ibm.com>
amicic
force-pushed
the
overflow_expand
branch
from
October 15, 2021 14:00
2419682 to
47804e2
Compare
dmitripivkine
approved these changes
Oct 15, 2021
Contributor
|
Jenkins test sanity xLinux jdk11 |
Member
|
This PR testing isn't going to work until artifactory is fixed. |
Contributor
|
Jenkins test sanity xLinux jdk11 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Total heap resizing (based on GC overhead heuristics) may suggest to
expand to a smaller value than current total heap size, leading to
contraction (what might not be problem by itself). The bigger problem is
that internally it's represented as a big (overflowed) unsigned integer
and while arithmetic (+/- operators) will silently work (we will
successfully contract), that's not the case for comparisons (<,>
operators).
If there was a large object alloc request and there is not free enough
memory we may want to expand, but since this alloc size is likely to be
less than the fake expand, it won't be able to trigger the real expand.
Eventually, this may lead to failing to allocate and OOM condition.
The fix is simply to prevent the overflow math and set the expansion
value to 0, if calculated value is negative.
Fixes: #13584
Signed-off-by: Aleksandar Micic amicic@ca.ibm.com