RFR 8250984: Memory Docker tests fail on some Linux kernels w/o swap limit capabilities
Bob Vandette
bob.vandette at oracle.com
Tue Sep 1 16:04:38 UTC 2020
I really dislike encoding all these strings in our tests that could possibly change.
I wish we did something like check for the existence of /sys/fs/cgroup/memory/memsw.limit_in_bytes
assuming that this file is not present when swap limiting is disabled. The problem with this approach
and yours is that we need to make that these fixes we can run on docker, podman, cgroupv1 and cgroupv2.
Others are struggling with these types of issues …
https://github.com/containers/podman/issues/6365
The Metrics API I added provides for the possibility that the call to getMemoryAndSwapLimit
could fail. Perhaps the test should be checking for not supported and fix the API implementation
to report the correct error (if it doesn’t already).
/**
* Returns the maximum amount of physical memory and swap space,
* in bytes, that can be allocated in the Isolation Group.
*
* @return The maximum amount of memory in bytes or -1 if
* there is no limit set or -2 if this metric is not supported.
*
*/
public long getMemoryAndSwapLimit();
My .02$
Bob.
> On Sep 1, 2020, at 11:31 AM, Harold Seigel <harold.seigel at oracle.com> wrote:
>
> Hi,
>
> Please review this fix to enable docker tests TestMemoryAwareness.java and TestDockerMemoryMetrics.java to run on Linux kernels configured without swap limit capabilities.
>
> Open Webrev: http://cr.openjdk.java.net/~hseigel/bug_8250984.dkr/webrev/index.html
>
> JBS Bug: https://bugs.openjdk.java.net/browse/JDK-8250984
>
> The modified tests were run on Linux kernels with and without swap limit capabilities.
>
> Thanks, Harold
>
More information about the hotspot-runtime-dev
mailing list