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

Yasumasa Suenaga ysuenaga at openjdk.org
Tue May 9 04:40:19 UTC 2023


On Tue, 9 May 2023 01:37:21 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/share/runtime/os.hpp line 314:
>> 
>>> 312: 
>>> 313:   static julong available_memory();
>>> 314:   static julong free_memory();
>> 
>> It would probably be a good idea to add a comment describing what the actual difference is between free/available (i.e. Linux only and usually `available memory > free memory` on such systems).
>
> Yes some detailed commentary is very necessary. It looks very odd to have two functions that do the same thing on every platform but Linux.

I added comments into os_linux.hpp . I will move them to os.hpp .
https://github.com/openjdk/jdk/pull/13398/files#diff-b6c4026228694834053813a8a8ea4795b5edb29eeb9cc46cd234c8e3b92336f4R61-R64

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

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


More information about the hotspot-compiler-dev mailing list