RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v16]
Severin Gehwolf
sgehwolf at openjdk.java.net
Thu May 12 12:10:51 UTC 2022
On Thu, 12 May 2022 09:50:39 GMT, xpbob <duke at openjdk.java.net> wrote:
>> set memory.swappiness to 0,swap space will not be used
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>>
>>
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305
>>
>> =>
>>
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> xpbob has updated the pull request incrementally with one additional commit since the last revision:
>
> add swap method
This looks good. I think the only thing missing is a test for the JDK side. Perhaps write one using the `OperatingSystemMXBean`'s `getTotalSwapSpaceSize()` method within a container with `--memory=200m --memory-swap=250m` and using `--memory-swappiness=0`. You could use `test/hotspot/jtreg/containers/docker/TestMemoryAwareness.java` and `CheckOperatingSystemMXBean.java` as a model. Again a cgroupsv1 specific test.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8285
More information about the core-libs-dev
mailing list