RFR: 8332362: Implement os::committed_in_range for MacOS and AIX [v6]
Thomas Stuefe
stuefe at openjdk.org
Mon Jun 17 15:56:17 UTC 2024
On Mon, 17 Jun 2024 15:40:23 GMT, Robert Toyonaga <duke at openjdk.org> wrote:
>> I might be doing something wrong, but this test consistently fails on my windows machine. The full committed region is returned even if it is untouched. If I try committing a huge amount of memory (that is untouched), `os::committed_in_range `will return the full region, although actual RSS has not increased. So I think `VirtualQuery` does indeed return the amount committed, but does not distinguish between paged-in or not, which is what this test intends to check.
>
> As a side note, maybe `os::committed_in_range` should have a different name. Perhaps the name is a bit misleading because we actually intend for this method to return the subset of committed memory that is paged-in. It's also a bit confusing that it does the _intended_ behaviour on some platforms but does the _suggested_ behaviour on other platforms (on windows it seems). Sometimes it does neither the intended or suggested behaviour and just returns the whole reserved region (AIX).
>
> Or perhaps the name of`os::committed_in_range` is correct and we truly intend for the function to return the region that is committed, regardless of whether it's using physical memory. In that case, my test needs to be changed. But then mincore wouldn't be a good implementation on POSIX, because it could under-represent the amount of committed memory.
> I might be doing something wrong, but this test consistently fails on my windows machine. The full committed region is returned even if it is untouched. If I try committing a huge amount of memory (that is untouched), `os::committed_in_range `will return the full region, although actual RSS has not increased. So I think `VirtualQuery` does indeed return the amount committed, but does not distinguish between paged-in or not, which is what this test intends to check.
We probably should query MEM_MAPPED, not MEM_COMMIT, after VirtualQuery
> As a side note, maybe `os::committed_in_range` should have a different name. Perhaps the name is a bit misleading because we actually intend for this method to return the subset of committed memory that is paged-in. It's also a bit confusing that it does the _intended_ behaviour on some platforms but does the _suggested_ behaviour on other platforms (on windows it seems). Sometimes it does neither the intended or suggested behaviour and just returns the whole reserved region (AIX).
True. Lets deal with that in a follow-up, and disable the tests for windows for now.
I opened https://bugs.openjdk.org/browse/JDK-8334403 and put it on your name :)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19455#discussion_r1643037602
More information about the hotspot-runtime-dev
mailing list