Max open files per process

前端 未结 2 1430
有刺的猬
有刺的猬 2020-12-30 16:51

What is a maximum open files count in Mac OS X (10.6) per process?

ulimit said than 256, sysctl said 10240, but my test program can create 9469 (under gdb), 10252 (w

2条回答
  •  天涯浪人
    2020-12-30 16:54

    I came across a relevant error when running some python script on my mac. The error was complaining about the limit of open files.

    I was actually quite surprised to see ulimit -n telling me 256.

    If you end up here to fix this, next logical step is to increase the limit.

    How to increase that limit

    To complement the answer by Dmitry I will link the following gist with the solution (worked for me on Mac OSX Catalina).

    The linked above recipe will instruct you how to increase the limit.

    /Library/LaunchDaemons/limit.maxfiles.plist
    /Library/LaunchDaemons/limit.maxproc.plist
    

    After applying the load.sh and a system rebot, I got ulimit -n saying 524288. This has made by python script happy. GL!

提交回复
热议问题