RFR: 8368089: G1: G1PeriodicGCTask::should_start_periodic_gc may use uninitialised value if os::loadavg is unsupported [v2]

Guanqiang Han ghan at openjdk.org
Mon Sep 22 13:23:58 UTC 2025


On Mon, 22 Sep 2025 08:33:07 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> Guanqiang Han has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update g1PeriodicGCTask.cpp
>>   
>>   Disable the functionality when os::loadavg() is not supported.
>
> src/hotspot/share/gc/g1/g1PeriodicGCTask.cpp line 61:
> 
>> 59:       log_debug(gc, periodic)("System loadavg not supported. Skipping.");
>> 60:       return false;
>> 61:     }
> 
> is `os::loadavg` support something that is fixed for a given run? It would maybe be nicer to fail the VM if `G1PeriodicGCSystemLoadThreshold` is set but `os::loadavg()` not supported. Or start with a warning and disable the functionality instead of printing the message over and over again.

Thanks! I’ve fixed it.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27413#discussion_r2368369297


More information about the hotspot-gc-dev mailing list