RFR: 8291060: OPEN_MAX is no longer the max limit on macOS >= 10.6 for RLIMIT_NOFILE

Gerard Ziemski gziemski at openjdk.org
Wed Jul 27 15:44:44 UTC 2022


On Wed, 27 Jul 2022 06:53:51 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> On macOS we are currently using setrlimit(RLIMIT_NOFILE, OPEN_MAX) for MaxFDLimit (it's ON by default), but we can go higher than that. 
>> 
>> My own testing on macOS 12.3.1 reveals that we can ask for setrlimit(RLIMIT_NOFILE, RLIM_INFINITY), though in reality we will get back 32765, which is still more than OPEN_MAX (10240)
>
> src/hotspot/os/bsd/os_bsd.cpp line 1993:
> 
>> 1991:     } else {
>> 1992:       // On macOS >= 10.6 if we define _DARWIN_UNLIMITED_STREAMS or _DARWIN_C_SOURCE
>> 1993:       // (we define _DARWIN_C_SOURCE) we can ask for RLIM_INFINITY
> 
> You could fold this information into the comment block below so that it is within the ifdef for APPLE.

Done.

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

PR: https://git.openjdk.org/jdk/pull/9650


More information about the hotspot-runtime-dev mailing list