RFR: 8299858: [Metrics] Swap memory limit reported incorrectly when too large [v3]

Severin Gehwolf sgehwolf at openjdk.org
Wed Jan 25 13:32:08 UTC 2023


On Wed, 25 Jan 2023 13:08:28 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> (I know you do an assert in java, but that has to be switched on explicitly - do we run tests with asserts enabled?)

Yes. That's why `-esa` is being added here:
https://github.com/openjdk/jdk/pull/12118/files#diff-597a72f91945acae784afe2610925a1da491f138eec44b98cb630414dac9cc76R204

I'll fix the other pre-existing issues you point out in another bug.

> src/java.base/linux/native/libjava/CgroupMetrics.c line 54:
> 
>> 52:     struct sysinfo si;
>> 53:     sysinfo(&si);
>> 54:     return (jlong)si.totalswap;
> 
> If sysinfo fails, we return a random value.

Makes sense. I think returning `0` (no swap) might be reasonable if it fails. I'll update.

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

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


More information about the core-libs-dev mailing list