RFR: 8332362: Implement os::committed_in_range for MacOS and AIX [v2]
Robert Toyonaga
duke at openjdk.org
Tue Jun 11 20:35:15 UTC 2024
On Tue, 11 Jun 2024 13:51:13 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Robert Toyonaga has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Remove debug log. Enable tests for aix.
>
> test/hotspot/gtest/runtime/test_committed_virtualmemory.cpp line 217:
>
>> 215: }
>> 216:
>> 217: #ifndef _WINDOWS
>
> Test should work on Windows, too
On Windows `os::committed_in_range` uses `VirtualQuery` which returns only whether the region is `MEM_COMMIT`. [A region that is set to `MEM_COMMIT` may not yet be faulted in.](https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualalloc) So unlike mincore, it's not actually useful for getting a fine-grained measurement of physical memory used, although it's helpful to find the parts of the thread stacks that are committed.
I did a quick check on my windows computer by committing a big amount of memory and checking the RSS. `os::committed_in_range` reports the memory as committed, but it's not reflected in the RSS. When I actually touch the chunk of committed memory, `os::committed_in_range` reports the same as before, but I can see it in the RSS this time.
> test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java line 43:
>
>> 41: * @test id=preTouch
>> 42: * @summary Test AlwaysPreTouchThreadStacks
>> 43: * @requires os.family != "aix"
>
> Should work on aix now, no?
yes, that's my bad. I neglected to take that out. Removed now.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19455#discussion_r1635447323
PR Review Comment: https://git.openjdk.org/jdk/pull/19455#discussion_r1635450820
More information about the hotspot-runtime-dev
mailing list