Recently, in a project to the Tomcat test, the normal user started Tomcat when the pressure will be reported java.lang.OutOfMemoryError error, this error is the system max user processes Problem.
When I landed on the server to view the ulimit of the system
ulimit -a core file size (blocks, -c) 0data seg size (kbytes, -d) unlimitedscheduling priority (-E) 0file size (blocks, -f) unlimitedpending signals (-i) 514585max locked memory (kbytes, -l) 64max memory size (kbytes, -m) unlimitedopen files (-N) 655360pipe size (512 BYTES, -P) 8POSIX message queues (bytes, -q) 819200real-time priority (-R) 0stack size (kbytes, -s) 8192cpu time (SECONDS, -T) unlimitedmax user processes (-u) 514585virtual memory (KBYTES, -V) unlimitedfile locks (-X) unlimiteD
Found that there is no problem, it is strange that the problem has been troubling for a long time, have not found the problem.
Later we used the root user to start Tomcat, then the pressure test, found that the problem has been resolved, no longer appear
Java.lang.OutOfMemoryError's error.
is the root user not the same value as the normal user Ulimit?
This time we switch to the normal user, to view the system's Ulimit discovery
core file size (blocks, -c) 0data seg size (kbytes, -d) unlimitedscheduling priority (-E) 0file size (blocks, -f) unlimitedpending signals (-i) 514585max locked memory (kbytes, -l) 64max memory size (kbytes, -m) unlimitedopen files (- N) 655360pipe size (512 bytes, -p) 8POSIX message queues (BYTES, -Q) 819200real-time priority (-R) 0stack size (kbytes, -s) 8192cpu time ( SECONDS, -T) unlimitedmax user processes (-u) 4096virtual memory (KBYTES, -V) unlimitedfile locks (-X) Unlimited
Why is the value of MAX user processes only 4096 for a normal user? So where does this value control from?
According to the truth, Ulimit values are modified by/etc/security/limits.conf, but we have made changes to/etc/security/limits.conf, but the value of max user processes is What's the difference?
Later we found that the value of the nproc below Ulimit is controlled by the/etc/security/limits.d/20-nproc.conf file. We view/etc/security/limits.d/20-nproc.conf file
# Default limit for number of user ' s processes to prevent# accidental fork bombs.# See Rhbz #432903 for reasoning.* Soft Nproc 4096root Soft Nproc Unlimited
Questions about common user Ulimit max user processes value in CentOS 7