RFR: 8305770: os::Linux::available_memory() should refer MemAvailable in /proc/meminfo [v5]

Yasumasa Suenaga ysuenaga at openjdk.org
Thu May 11 06:14:57 UTC 2023


On Thu, 11 May 2023 04:18:06 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Move description for MemFree and MemAvailable to os.hpp
>
> src/hotspot/share/runtime/os.hpp line 316:
> 
>> 314:   // than free memory (MemFree in /proc/meminfo) because Linux would use
>> 315:   // free memory aggressively (e.g. caches).
>> 316:   // Thus we distinguish free memory and available memory in Linux.
> 
> May I suggest a slight refocus:
> 
> // On some platforms there is a distinction between "available" memory and "free" memory.
> // For example, on Linux, "available" memory (`MemAvailable` in `/proc/meminfo`) is greater
> // than "free" memory (`MemFree` in `/proc/meminfo`) because Linux can free memory
> // aggressively (e.g. clear caches) so that it becomes available.

Thanks @dholmes-ora ! I updated comments.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13398#discussion_r1190676912


More information about the hotspot-compiler-dev mailing list