RFR: 8323640: [TESTBUG]testMemoryFailCount in jdk/internal/platform/docker/TestDockerMemoryMetrics.java always fail because OOM killed
sendaoYan
duke at openjdk.org
Tue Jan 23 01:45:27 UTC 2024
On Mon, 22 Jan 2024 15:03:18 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
> `1k` increments for a total of `512k` times seems overkill. Are you sure that's needed to make the test pass? How about `1MB` increments for a total of `512` times?
When the docker serivice work normally on the test machine, this test will always fail. This test want to verify the API `jdk.internal.platform.Metrics.systemMetrics().getMemoryFailCount()` work normally or not. The API return memory allocate fail times in jvm. But, before this PR, everytime it allocate `1M` memory, the API has no chance the catch the memory allocate fail, the jvm was killed by OOM. Change `8M` increments to `1K` mean to avoid OOM killed for the jvm in docker container.
jvm was killed by OOM in docker container:
![image](https://github.com/openjdk/jdk/assets/24123821/c00697cc-ceef-410e-a8b9-7c401fa76134)
`1M` Increnents also can avoid OOM killed.
![image](https://github.com/openjdk/jdk/assets/24123821/bab0a753-d15c-4759-a557-b8feafaa97cb)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17514#issuecomment-1905139487
More information about the core-libs-dev
mailing list