8351011: Serial GC: Use a single VirtualSpace for both young and tenured generations #24785
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.
JEP draft JDK-8350152 (Automatic Heap Sizing for the Serial Garbage Collector) proposes dynamically sizing the young generation using GC overhead and adding support for committing and uncommitting memory depending on global memory pressure. The current implementation of the serial collector reserves a single block of memory for the entire heap then splits it into two ReservedSpaces, one for the young generation and another for the tenured generation. Each of the generations then individually commits and uncommits memory.
One drawback of this approach is that with dynamic sizing of the generations, fixed limits of the reserved spaces for each generation will not be compatible with the newly computed region sizes. A possible workaround is to reserve twice the maximum heap size to enable each generation to grow to the dynamically computed sizes. However, there would now be two memory regions to manage when committing and uncommitting memory.
This PR adds an experimental flag, -XX:+SharedSerialGCVirtualSpace, to enable the use of a single reserved space and dynamically partitioning its committed memory into tenured and young regions for the automatic heap sizing scenario.
This PR builds on #23853 by adding to it commit 98f1bfc
Progress
Warnings
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24785/head:pull/24785
$ git checkout pull/24785
Update a local copy of the PR:
$ git checkout pull/24785
$ git pull https://git.openjdk.org/jdk.git pull/24785/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 24785
View PR using the GUI difftool:
$ git pr show -t 24785
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24785.diff