RFR: 8334489: Add function os::used_memory [v3]

Severin Gehwolf sgehwolf at openjdk.org
Thu Jun 20 17:26:14 UTC 2024


On Thu, 20 Jun 2024 16:58:40 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> src/hotspot/share/runtime/os.cpp line 2074:
>> 
>>> 2072:       return mem_usage;
>>> 2073:     }
>>> 2074:   }
>> 
>> I'm not sure we should introduce Linux specific things in the shared os code like that. It seems the model is to use `pd_<foo>` to delegate to platform specific code? @dholmes-ora thoughts?
>
> I think that is okay here. Sometimes its the lesser of two evils.
> 
> I actually understood David's remark that way, too (https://github.com/openjdk/jdk/pull/19772#pullrequestreview-2127842338)

I understood the remark as "reduce the default implementation duplication". I.e. not have the same impl for all platforms. A pd_<foo> would just move the impl to `os/linux` rather than having it in `share/runtime`. But if that's fine, then I won't object, of course.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19772#discussion_r1647909704


More information about the hotspot-runtime-dev mailing list