-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8328168: Epsilon: Premature OOM when allocating object larger than uncommitted heap size #18304
Conversation
👋 Welcome back gli! A progress list of the required criteria for merging this PR into |
@lgxbslgx This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 13 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
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.
Oh. So the critical change is here:
} else if (size_in_bytes < unused_space) {
// No space to expand in bulk, and this allocation is still possible,
// take all the remaining space:
Before this fix, we might have had some unused, but already expanded space. But we would miss this, since we only checked how much there was left to expand to. Which means we still have space to afford the allocations, we instead we just throw a premature OOM. Whoops.
I suggest we rename the issue to Epsilon: Premature OOM when allocating object larger than uncommitted heap 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.
(meant to request changes)
|
This problem can be solved after #18303 integrating. I shouldn't have merged the master so quickly. |
The parent pull request that this pull request depends on has now been integrated and the target branch of this pull request has been updated. This means that changes from the dependent pull request can start to show up as belonging to this pull request, which may be confusing for reviewers. To remedy this situation, simply merge the latest changes from the new target branch into this pull request by running commands similar to these in the local repository for your personal fork: git checkout FAILED-ALLOCATION
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# if there are conflicts, follow the instructions given by git merge
git commit -m "Merge master"
git push |
# Conflicts: # src/hotspot/share/gc/epsilon/epsilonHeap.cpp
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 looks fine, thanks.
@shipilev Thanks for your review. Waiting for another review. |
Going to push as commit 7baec66.
Your commit was automatically rebased without conflicts. |
Hi all,
When an object size meets the following three conditions, the allocation will fail unexpectedly.
object_size
>uncommitted_size
object_size
>committed_but_unused_size
object_size
<unused_size
(unused_size
equalsuncommitted_size + committed_but_unused_size
)Please read the newly added test of this patch for the concrete case.
Thanks for taking the time to review.
Best Regrads,
-- Guoxiong
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18304/head:pull/18304
$ git checkout pull/18304
Update a local copy of the PR:
$ git checkout pull/18304
$ git pull https://git.openjdk.org/jdk.git pull/18304/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18304
View PR using the GUI difftool:
$ git pr show -t 18304
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18304.diff
Webrev
Link to Webrev Comment