In Linux, I can check the max allowed open files (ulimit) of a process by simply executing
$ cat /proc/<PID>/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 14248 14248 processes
Max open files 1024 1048576 files
Max locked memory 67108864 67108864 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 14248 14248 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
How can I do this in MacOS?
Thanks a lot.
PS1: I knew how to run ulimit
commands to check the current ulimit setup. But I don't know how to check and verify those values for a running process.
PS2: I knew how to use lsof
to check how many files a process is opening. But it doesn't tell the max number of files a process can open.
lsof
comand before opening this question. They are not the same question. Knowing the number of current open files has nothing to do with knowing the number of max allowed open files for a process. I would like to know a way to figure out the max number of running process or app. Thanks again.