RFR: 8281946: VM.native_memory should report size of shareable memory [v2]
Matias Saavedra Silva
matsaave at openjdk.org
Mon Dec 5 17:08:12 UTC 2022
On Sat, 3 Dec 2022 09:09:11 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> Hi Matias,
>
> Nice, this is useful! Small nits, but nothing major.
>
> About the terminology: Ioi did suggest "shareable", whereas you use "readonly". IMHO "shareable" is a bit clearer, and also more correct since on Windows, that memory is not readonly. Also, you can have read-only mappings that are not shareable, and rw mappings that are.
>
> Long term, not for this RFE: it would be cool if we could track shareability inside NMT as property of a mapping info. Or even just query the OS if the mapping is shared or private. That way we can remove any flag-specific special handling from NMT, and become a lot more flexible (e.g. if someone shares memory for a different MEMFLAG).
>
> Cheers, Thomas
The choice to use readonly over shareable was another suggestion by @iklam. Here is some rationale:
"Other mmaped pages can be shareable if they are writable but has not been modified by the JVM process (ie copy-on-write pages)"
-------------
PR: https://git.openjdk.org/jdk/pull/11401
More information about the hotspot-runtime-dev
mailing list