RFR: 8331539: [REDO] NMT: add/make a mandatory MEMFLAGS argument to family of os::reserve/commit/uncommit memory API [v2]
Afshin Zafari
azafari at openjdk.org
Fri May 24 13:13:04 UTC 2024
On Fri, 24 May 2024 10:14:41 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
>> The logic is that, a large region `total_space_rs` is reserved and then is split into two sub regions. It doesn't matter what is the flag for `total_space_rs`. At split time the flags are set correctly for sub regions.
>
> The flags sent to the NMT subsystem is correct, but the flags recorded in the ReservedSpaces will be wrong, AFAIKT. You can probably verify that by adding asserts.
If your comment refers only to these lines of code, they are already verified. Since, inside the split function, the sub-regions get the new flags and all the reserved and committed amounts are moved from the large region to the new ones. So, the accounting of memory is correct.
FWIW, if we trace down the call at line 1346 of `total_space_rs = Metaspace::reserve_address_space_for_compressed_classes(total_range_size, false /* optimize_for_zero_base */);` the region may get different flags of `mtClass` or `mtMetaspace` based on the checked criteria down there.
If you comment on all such cases, then I will double check for them and add assertion for.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19343#discussion_r1613462000
More information about the shenandoah-dev
mailing list