8351011: Serial GC: Use a single VirtualSpace for both young and tenured generations#26
8351011: Serial GC: Use a single VirtualSpace for both young and tenured generations#26swesonga wants to merge 23 commits into
Conversation
|
Some comments/questions added. As you've mentioned, thorough testing w/ and w/o the shared virtual space (and making sure there are no regressions in existing code), along with code coverage testing, will be important. |
@brianjstafford - please review the changes I've made to see whether your feedback has been adequately addressed |
| void resize_covered_region(MemRegion new_region); | ||
|
|
||
| // Resize both of the regions covered by the remembered set. | ||
| void resize_covered_region_in_shared_virtual_space(MemRegion new_heap_region0, MemRegion new_heap_region1); |
There was a problem hiding this comment.
Should this be "covered_regions", i.e., plural?
There was a problem hiding this comment.
Should this be "covered_regions", i.e., plural?
It is just 1 region from the point of view of the card table. I think my comment here is what I should update. I'll fix the comment in the upstream PR.
|
Changes look good - just added one minor question for clarification. |
This fixes a segfault caused by clearing the from/to spaces unconditionally when the size of the young gen has not changed.
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.
The new commit not in previous PRs is 4307f5c