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
8214455: Relocate CDS archived regions to the top of the G1 heap #3349
8214455: Relocate CDS archived regions to the top of the G1 heap #3349
Conversation
👋 Welcome back iklam! A progress list of the required criteria for merging this PR into |
/label add hotspot-gc |
@iklam |
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.
Lgtm.
src/hotspot/share/memory/filemap.cpp
Outdated
@@ -1837,6 +1842,9 @@ void FileMapInfo::map_heap_regions_impl() { | |||
log_info(cds)("the desired range " PTR_FORMAT " - " PTR_FORMAT, p2i(range.start()), p2i(range.end())); | |||
log_info(cds)("is outside of the heap " PTR_FORMAT " - " PTR_FORMAT, p2i(CompressedOops::begin()), p2i(CompressedOops::end())); | |||
_heap_pointers_need_patching = true; | |||
} else if (header()->heap_end() != CompressedOops::end()) { | |||
log_info(cds)("CDS heap data need to be relocated to the end of the runtime heap to reduce fragmentation"); |
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.
s/need/needs
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.
Fixed.
* @summary Relocate CDS archived regions to the top of the G1 heap | ||
* @bug 8214455 | ||
* @requires vm.cds.archived.java.heap | ||
* @requires (sun.arch.data.model == "64" & os.maxMemory > 4g) |
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.
additional space before the &
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.
Fixed. Thanks for the review.
@iklam 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 1 new commit pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
// First, make sure the test runs without CDS | ||
TestCommon.runWithoutCDS(TestCommon.concat(execArgs, runTimeHeapSize, mainClass, BUFF_SIZE)) | ||
.assertNormalExit(successOutput); | ||
|
||
// Run with CDS. The archived heap regions should be relocated to avoid fragmentation. | ||
TestCommon.run(TestCommon.concat(execArgs, runTimeHeapSize, mainClass, BUFF_SIZE)) | ||
.assertNormalExit(successOutput); |
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.
The assertNormalExit line should be indented four spaces relative to the previous line.
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.
Looks good. Just one minor nit in the test case.
Thanks @tschatzl and @calvinccheung for the review. |
@iklam Since your change was applied there have been 4 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 78d1164. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
When the runtime heap and dump time heap have different sizes, it's possible that the archived heap regions are mapped to the middle of the runtime heap. Because the archived heap regions are pinned, this could reduce the size of the largest "humongous" array allocation. In the worst case, the maximum allocatable array length may be half of the optimal value.
The fix is to relocate the archived regions to the top of the G1 heap (currently archived regions are supported only by G1 on 64-bit JVM).
Note that usually the top of the G1 heap is placed just below the 32GB boundary. As a result, the archived heap regions are at the same location between run time and dump time, so no relocation is necessary.
In mach5 testing, we occasionally run into this problem (see https://bugs.openjdk.java.net/browse/JDK-8239089), probably because we fail to reserve the heap below 32GB due to address space layout randomization (ASLR).
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3349/head:pull/3349
$ git checkout pull/3349
Update a local copy of the PR:
$ git checkout pull/3349
$ git pull https://git.openjdk.java.net/jdk pull/3349/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3349
View PR using the GUI difftool:
$ git pr show -t 3349
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3349.diff