Tuesday, February 27, 2024
Google search engine
HomeUncategorizedmacOS 13.5 no longer allows setting system wide ulimits

macOS 13.5 no longer allows setting system wide ulimits

I am currently not able to change the ulimit on my machine. As of the newest MacOs releases (11.7.9, 12.6.8, and 13.5) I am no longer able to increase the ulimit of my computer using the strategies outlined here:

  • https://wilsonmar.github.io/maximum-limits/
  • https://apple.stackexchange.com/questions/453050/how-to-increase-global-maxfiles-ulimit-on-osx-13-1-ventura?newreg=44fe471004094ccdb3ba51c1c3f9f84a

Running sudo launchctl limit maxfiles 65536 200000 returns Could not set resource limits: 150: Operation not permitted while System Integrity Protection is engaged.

This is relevant for me as I am using Vite which is currently broken and blocks me from developing locally. It is mentioned in their troubleshooting page (https://vitejs.dev/guide/troubleshooting.html#requests-are-stalled-forever) that Vite causes a large number of open files and how to increase the limit. There are similar comments in the Ruby Vite troubleshooting page (https://vite-ruby.netlify.app/guide/troubleshooting.html#requests-to-vite-sporadically-return-a-500-error-response). I have added a comment in the Vite discussion board about this issue.

There is a discussion the Apple Stack Exchange that reports this problem but no one has provided a solution yet (https://apple.stackexchange.com/questions/462489/how-to-increase-global-max-opened-files-limit-on-osx-13-5-ventura)

Replies

Changing a system-wide setting to work around an issue with a specific product seems rather extreme. A better option would be to change it for that process specifically. If you have access to the code, add a call to setrlimit. If you don’t have access to the code, you could work out how the code is launched and add a wrapper, using either a shell script (and hence ulimit) or a native executable (setrlimit again).

Share and Enjoy





Quinn “The Eskimo!” @ Developer Technical Support @ Apple


let myEmail = "eskimo" + "1" + "@" + "apple.com"

Vite isn’t the only tool affected.

Maven also fails on any moderately sized project as well since any non-trivial project can require more than 256 open files for compilation.

Is there another solution that can be applied systemwide instead of writing wrappers for each tool I notice that is broken after 13.5?

Is there another solution that can be applied systemwide … ?

There is no direct replacement for the previous launchctl mechanism. The fact that this was placed behind a SIP barrier indicates that this is not accidental.

IMO there are three paths forward:

  • If you hit this limit running programs from a shell, use ulimit to change the settings in your shell. You can do this either interactively or in your profile.

  • If you hit this with a GUI app, I recommend that you discuss this with the app’s vendor.

  • If you hit this with some sort of Unix-y daemon or agent, you can tweak the settings in its launchd property list. You might also want to raise this with the program’s vendor, because having a configuration option for this would make sense.

Share and Enjoy





Quinn “The Eskimo!” @ Developer Technical Support @ Apple


let myEmail = "eskimo" + "1" + "@" + "apple.com"

I wonder what the appropriate action is, for something like IntelliJ IDEA. The limit has to be changed for IntelliJ itself, Maven, npm. Probably need to change the limit for whatever compiler is used (java, javascript…)

For IntelliJ you can set the maxFile limit at process level from the terminal and then run IntelliJ IDE from that Shell
Commands to increase the limit at process level
ulimit -Sn 524288
ulimit -Hn 10485760
Then run this command to the IDE
/Applications/Intellij IDEA.app/Contents/MacOS/idea

Read More

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments