The failcount child allocates 1M arrays until memory.events max moves. Under 
podman with the systemd cgroup manager, rootless or rootful, the pid sits in a 
sub cgroup of the libpod scope, both with the same memory.max. The scope holds 
a few pages of its own, the sub cgroup's percpu and slab. At the limit a 4K 
charge fails on the scope first and the max event is counted there, outside the 
container's cgroupns. The leaf sees one only on a bigger charge, a THP fault 
mostly, and on a rootful run here not at all. When none comes the count stays 0 
and the loop runs into the heap. 768m heap, 1M G1 regions, a 1M array is 
humongous and takes two regions. 384 fit. The JVM dies around the 380th array 
while reading the counter.

Two changes in the tester. The loop stops at 256 arrays. If the count did not 
move but memory and swap usage went past the memory limit, the limit was 
enforced somewhere the container can't observe. The tester prints the existing 
Ignoring test marker and the driver skips, the same way it already skips when 
the environment can't support the test. Count unchanged without swap use is 
still a failure.

The skip covers the whole test, the soft limit case after it does not run. Same 
as the existing skips.


---------
- [x] The tester run directly in the OL9 x64 image with the CI container and 
heap flags, rootless with THP enabled it passes with count 1, with THP disabled 
it reaches the new skip, rootful it reaches the skip, exit 0 and no OOME in all 
three; the CI podman OL9 tasks (jdk/internal/platform/docker, linux-x64 and 
linux-aarch64 debug) five runs each,  tier1-3 linux-x64 




---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

-------------

Commit messages:
 - 8392122: Test jdk/internal/platform/docker/TestDockerMemoryMetrics.java 
fails with OutOfMemoryError

Changes: https://git.openjdk.org/jdk/pull/33187/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=33187&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8392122
  Stats: 10 lines in 1 file changed: 7 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/33187.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/33187/head:pull/33187

PR: https://git.openjdk.org/jdk/pull/33187

Reply via email to