[crac] RFR: List open FDs through reading /proc/self/fd

Radim Vansa duke at openjdk.org
Thu May 25 14:50:30 UTC 2023


On Thu, 25 May 2023 12:52:46 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

>> Previously the code was iterating through all possible FD values, up to highest allowed FD number, and required allocation of possibly huge array. Reading /proc/self/fd into a compact array is both more memory efficient and does not require excessive syscalls.
>
> src/hotspot/os/linux/os_linux.cpp line 5814:
> 
>> 5812:       // skip "." and ".."
>> 5813:       continue;
>> 5814:     }
> 
> May be just look at the first char `== '.'`?

I think that checking parse-ability is better, but I don't insist, the dir should not contain anything else.

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

PR Review Comment: https://git.openjdk.org/crac/pull/67#discussion_r1205633273


More information about the crac-dev mailing list