RFR: 8292206: TestCgroupMetrics.java fails as getMemoryUsage() is lower than expected [v2]

Ioi Lam iklam at openjdk.org
Wed Dec 21 20:49:24 UTC 2022


> The `testMemoryUsage()` test scenario queries the total memory usage of all processes of the current Linux user, including other concurrently running jtreg test cases. Even if the current process allocates 256MB of ram, it's possible for other dying processes to release much more than that amount. Therefore, it's not possible to guarantee that `Metrics.getMemoryUsage()` would return a higher number.
> 
> I am removing this test scenario for now as I don't see it providing any actual value.
> 
> If we want to have more in-depth functional tests for the `Metrics.getMemoryXXX()` APIs, we need to do it inside a container in a more controlled setting.

Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:

  @jerboaa comments -- disable memory metric tests only when running outside of container

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/11734/files
  - new: https://git.openjdk.org/jdk/pull/11734/files/8f27544b..8c1ca8b4

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=11734&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=11734&range=00-01

  Stats: 85 lines in 6 files changed: 69 ins; 9 del; 7 mod
  Patch: https://git.openjdk.org/jdk/pull/11734.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11734/head:pull/11734

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


More information about the hotspot-runtime-dev mailing list