RFR: 8330076: [NMT] add/make a mandatory MEMFLAGS argument to family of os::reserve/commit/uncommit memory API [v13]
Afshin Zafari
azafari at openjdk.org
Tue Apr 23 08:59:34 UTC 2024
On Tue, 23 Apr 2024 06:47:00 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> src/hotspot/share/gc/parallel/mutableSpace.cpp line 63:
>>
>>> 61: if (clear_space) {
>>> 62: // Prefer page reallocation to migration.
>>> 63: os::free_memory((char*)start, size, page_size, mtGC);
>>
>> Not at all obvious where the corresponding allocation sets the type as mtGC. ??
>
> We don't, and I am not sure this is right. AFAICS this API is used on java heap, in ParallelGC. So, that should be mtJavaHeap, I think.
>
> Note that I would like and plan to simplify this API, if possible remove both the page size and the NMT flags. See https://bugs.openjdk.org/browse/JDK-8330144. (the tricky part is to make sure the proposed Linux alternative works with large pages and on old enough kernels)
`os::free_memory` on Linux, re-commits the region to discard the existing committed memory. So MEMFLAGS is needed here to pass down to the `os::commit_memory` there.
Since it is actually an uncommit, can we use `mtNone` instead in the `pd_free_memory`? Or define a new `mtDontCare`, for example?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18745#discussion_r1575894505
More information about the shenandoah-dev
mailing list