RFR: 8332362: Implement os::committed_in_range for MacOS and AIX [v6]
Robert Toyonaga
duke at openjdk.org
Mon Jun 17 15:43:17 UTC 2024
On Mon, 17 Jun 2024 15:39:06 GMT, Robert Toyonaga <duke at openjdk.org> wrote:
>> test/hotspot/gtest/runtime/test_committed_virtualmemory.cpp line 218:
>>
>>> 216: }
>>> 217:
>>> 218: #if !defined(_WINDOWS) && !defined(_AIX)
>>
>> Please also execute for windows. We should use VirtualQuery on windows, that should work.
>
> 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).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19455#discussion_r1643018375
More information about the hotspot-runtime-dev
mailing list