RFR: 8214455: Relocate CDS archived regions to the top of the G1 heap [v2]
Calvin Cheung
ccheung at openjdk.java.net
Wed Apr 7 05:38:25 UTC 2021
On Tue, 6 Apr 2021 17:04:18 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> 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).
>
> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>
> @tschatzl review -- fix typos and whitespace
Looks good. Just one minor nit in the test case.
test/hotspot/jtreg/runtime/cds/appcds/cacheObject/HeapFragmentationTest.java line 84:
> 82: // Run with CDS. The archived heap regions should be relocated to avoid fragmentation.
> 83: TestCommon.run(TestCommon.concat(execArgs, runTimeHeapSize, mainClass, BUFF_SIZE))
> 84: .assertNormalExit(successOutput);
The assertNormalExit line should be indented four spaces relative to the previous line.
-------------
Marked as reviewed by ccheung (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/3349
More information about the hotspot-gc-dev
mailing list