That number is exactly what you would get by doing getrlimit
on RLIMIT_NPROC
. That is described in the manual page:
The maximum number of processes (or, more precisely on Linux, threads) that can be created for the real user ID of the calling process. Upon encountering this limit, fork(2) fails with the error EAGAIN.
So every time you fork the system checks all your processes before allowing this one process to fork
. If you lower the limit for some process - perhaps with ulimit
for the shell or with setrlimit
- the system still counts all your processes but it checks the number against the new limit.