RFR: 8333522: JFR SwapSpace event might read wrong free swap space size
Severin Gehwolf
sgehwolf at openjdk.org
Thu Jun 6 12:47:43 UTC 2024
On Thu, 6 Jun 2024 12:22:18 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
> > I see that if `sysinfo()` fails the return value might be negative. Should we account for that?
>
> There are a number of places where sysinfo return value check is omitted. I see 3 places in os_linux.cpp alone. probably it would be better to check this, but I am not sure why it was omitted and how often those failures occur in practise .
We could add an `assert(host_free_swap_val >= 0, "sysinfo failed?");`. That would at least guard for that case in debug builds. And it would show it's been considered.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19574#issuecomment-2152322416
More information about the hotspot-runtime-dev
mailing list