RFR: 8323640: [TESTBUG]testMemoryFailCount in jdk/internal/platform/docker/TestDockerMemoryMetrics.java always fail because OOM killed

sendaoYan duke at openjdk.org
Fri Jan 12 15:35:20 UTC 2024


On Fri, 12 Jan 2024 03:31:37 GMT, sendaoYan <duke at openjdk.org> wrote:

> Reviewed-by: Yi Yang

The test case before this PR has a maximum heap of 64MB and applies for 8M of memory each time in the for loop. When applying for memory for the sixth time, it was killed by the docker container because of OOM, jdk.internal.platform.Metrics.systemMetrics().getMemoryFailCount( ) interface has no chance to return 1, and the Java process returns exit code 137. The maximum heap is also 64M, The PR is changed to 1KB each time to ensure that the getMemoryFailCount() interface has a chance to return 1 and the test case has a chance to exit the for loop of memory allocation.

## test result before this PR:

![image](https://github.com/openjdk/jdk/assets/24123821/4554dd00-6da5-4529-907a-45e2df5c902b)


## test result after this PR:

![image](https://github.com/openjdk/jdk/assets/24123821/32ea4fc8-aa04-425e-8481-a920265d2b1f)

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

PR Comment: https://git.openjdk.org/jdk/pull/17386#issuecomment-1889517014


More information about the core-libs-dev mailing list