RFR: 8296125: Add a command line option to set a refresh rate of the OS cached metrics in Linux [v2]

Ioi Lam iklam at openjdk.org
Wed Nov 2 18:23:28 UTC 2022


On Wed, 2 Nov 2022 18:04:34 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> Do you have any benchmark that shows the benefit of this switch? We don't want to add a switch, even a diagnostic one, just on a suspicion.

Also, we need to measure the actual cost of reading the OS metrics. As far as I know, it's just parsing a very simple text string. It's hard to imagine that it would cause any difference if you do it 50 times per second vs 10 times per second.

(The original fix, [JDK-8232207](https://bugs.openjdk.org/browse/JDK-8232207), reduces the refresh rate from something like 1000 times per second to 50 times per second, which made a real difference).

However, if you delay updating the OS metrics, you will be running with the old metrics for a longer time. For example, if the memory limit has been reduced, the correct behavior might be to shrink the size of some application caches which would result in lower performance. By changing the refresh rate to 100ms, you effectively would use the larger cache for a longer time, so the measured performance would be higher.

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

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


More information about the hotspot-runtime-dev mailing list