On Linux threads count towards the
ulimit -u count, but they don't show up normally with
ps -A. You need to add the
eg on my machine:
% ps -A | wc -l
% ps -AL | wc -l
We can see there's 31 more processes running; these are threads, normally hidden from view.
With java and other highly threaded applications it can be easy to run more threads/processes than you think. Your
ulimit -u value needs to take this into account.
This can unexpectedly hit people running a lot of java applications on RedHat systems where it comes, by default, with a
% cat /etc/security/limits.d/20-nproc.conf
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.
* soft nproc 4096
root soft nproc unlimited