11

I already had configured max opened files limit and it worked fine until I updated to Ventura 13.5. The limit is reset to default value now.

I tried to follow answer from this question: How to increase global maxfiles ulimit on OSX 13.1 Ventura

It worked until I enabled System Integrity Protection back via csrutil enable. When I enabled it back, the limit was reset to default value again. And I can't just disable System Integrity Protection because of company policy.

Is there a fix or a workaround for this? Or is it just a bug and we have to wait for next version or rollback to previous?

3 Answers 3

5

Apple has acknowledged that this is a bug and provided a workaround on their Developer forum article "No Longer Able to Increase Maxfile Limits MacOS Recent Versions"

For me, the following command worked:

sudo launchctl limit maxfiles 128000 524288

After that, I set ulimit like where softlimit is equal to hardlimit of maxfiles.

ulimit -n 524288 10485760

To persist the above change follow the GitHub Gist post "How to Change Open Files Limit on OS X and macOS"

0

I have the same problem. Here is what I did.

Context:

  • launchctl limit maxfiles --> maxfiles 256 unlimited

256 is by far not enough for my application

Actions:

  • more /Library/LaunchDaemons/limit.maxfiles.plist

to examine the /Library/LaunchDaemons/limit.maxfiles.plist file, there the limits were 20000 20000

  • reboot with +R (recovery mode)
  • launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist

to modify permanently the 2 limits

  • reboot normally

At that point, my problem was solved. But

  • I did not re-enable crsutil (I'll try when I'll have made up for the time lost on this Apple bug, but as I am the sole user of this machine and that type of modification can only be done in recovery mode, I feel quite safe to stay this way...)
  • there is a curious discrepancy:

ulimit -> unlimited

ulimit -Sn 20000

ulimit -Hn 20000

I hope this can help.

3
  • 1
    Unfortunately disabling System Integrity Protection indefinitely is not a viable solution for most users. Does anyone have an answer that does not involve permanently disabling SIP?
    – akowalz
    Commented Aug 16, 2023 at 18:23
  • 1
    Thank you for response, but yes, unfortunately I can't keep SIP turned off
    – Mugenor
    Commented Aug 17, 2023 at 7:57
  • 1
    Disabling SIP is not an option. Did anyone report this issue on apple forum? Everything was working just fine till 13.5 upgrade. Tried 13.5.1 upgrade too, it did not help.
    – KaustubhK
    Commented Aug 18, 2023 at 7:45
0

I brought this to the Apple forum and the answer I received there helped me to add a fix. Since I knew what process was opening the high volume of files I went with the wrapper approach and added the following bash file:

#!/bin/bash

ulimit -n 2000000
exec <process that is opening a large number of files>

Running this bash file instead of the process directly allowed me to run a Vite server which opens a large number of files despite not being able to change the global maxfile limits on my Mac on the newest OS.

1
  • For me this just prints line 3: ulimit: open files: cannot modify limit: Operation not permitted and does not allow to call ulimit.
    – Bruno E.
    Commented Aug 30, 2023 at 10:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .