RFR: 8334489: Add function os::used_memory [v2]
Erik Österlund
eosterlund at openjdk.org
Wed Jun 19 20:30:10 UTC 2024
On Wed, 19 Jun 2024 18:47:11 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
> I don't understand. Now it's a linux only API? Wasn't the intention to have it available on all, but a shared impl for all except Linux, like in `os.cpp`?
>
>
>
> Something like:
>
> ```
>
> LINUX_ONLY(static julong pd_used_memory();)
>
> ...
>
> julong os::used_memory() {
>
> #ifdef LINUX
>
> return os::pd_used_memory();
>
> #else
>
> return os::physical_memory() - os::available_memory();
>
> #endif
>
> }
That was indeed the intention.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19772#discussion_r1646660171
More information about the hotspot-runtime-dev
mailing list