RFR: 8359104: gc/TestAlwaysPreTouchBehavior.java#<gcname> fails on Linux [v3]

Andreas Steiner asteiner at openjdk.org
Thu Sep 11 14:32:23 UTC 2025


On Thu, 11 Sep 2025 12:58:55 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> src/hotspot/os/linux/os_linux.cpp line 2382:
>> 
>>> 2380:   info->rss = info->pss = info->pssdirty = info->pssanon =
>>> 2381:       info->pssfile = info->pssshmem = info->swap = info->swappss = -1;
>>> 2382:   if (f != nullptr) {
>> 
>> You could consider inverting this check, and early-return `false` if `f==nullptr`. That would spare one indentation level
>
> I agree; the null-check should be done right after `fopen` to early-return if sth is wrong.

Even this was copied from the existing query_process_memory_info I adapted this now.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27192#discussion_r2341149494


More information about the hotspot-dev mailing list