RFR: 8255917: runtime/cds/SharedBaseAddress.java failed "assert(reserved_rgn != 0LL) failed: No reserved region" [v2]

Calvin Cheung ccheung at openjdk.java.net
Sat Dec 12 00:48:56 UTC 2020


On Sat, 12 Dec 2020 00:28:12 GMT, Yumin Qi <minqi at openjdk.org> wrote:

>> Hi, Please review
>>   (This is redo for https://github.com/openjdk/jdk/pull/1657)
>>    Windows mapping for file into memory could not happen to reserved memory. In mapping CDS archive we first reserve enough memory then before mapping, release them. For cds archive and using class space, need split the whole space into two spaces. To do so, we need release the whole first then do the reserve again on the split, which is problematic that there is possibility other thread or system can kick in to take the released space.
>>   The fix is the first step of two steps:
>>   1) Do not split reserved memory;
>>   2) Remove splitting memory.
>>   This fix is first step, for Windows and use requested mapping address, reserved for cds archive and ccs on a contiguous space separately, so there is no need to call split. If any reservation failed, go to other way, but do not do the 'real' split for the whole reserved space, keep the whole region reserved and released as a whole.
>>   Also fixed issues that when loading shared archive failed,  bitmap region should be unmapped or it will cause mismatch in reserved/committed size calculation for NMT.
>>   Fixed reserved region name for adding committed region for NMT, it should use the reserved region name not "Unknown" the default. 
>>   A test case added for testing the failed case which is caused by mismatch of class path.
>> 
>> Tests:tier1-5,tier7
>
> Yumin Qi has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Use default timeout number (120) for the test

One more comment regarding the test. Up to you if you want to make the change.

test/hotspot/jtreg/runtime/cds/appcds/MismatchedPathTriggerMemoryRelease.java line 61:

> 59:                                      "-XX:NativeMemoryTracking=detail",
> 60:                                      "-XX:SharedBaseAddress=0",
> 61:                                      "Hello");

Instead of `TestCommon.exec`, you could use `TestCommon.execAuto` and no need to pass the `-Xshare:auto` argument.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1750


More information about the hotspot-dev mailing list