Had a user that kept saying his machine ran out of memory. How that is possible was confusing me. This machine had 32 gb of ram. No way is it running out of memory which was the case.
Some error messages:
Java can't start. Out of memory.
Java garbage collector can't start. No memory available.
By default the max open files is only set to 1024. It is more about process threads instead of actual open files. Here is how I fixed it.
To find out how many threads you currently have open:
ps -eLf | "username" (don't type the quotes) | wc -l
Compare that number to:
2 numbers that matter:
-Max open files
Need to change the following:
add fs.file-max = 65536
add the following:
* soft nproc 65535
* hard nproc 65535
* soft nofile 65535
* hard nofile 65535
Rerun cat /proc/self/limit or ulimit -n
Verify the number has changed. If it has not you will also have to comment out the one line in this file.
Comment out the line with * nproc.
Also if you wanted to script this:
echo "fs.file-max = 65536" >> /etc/sysconf.
echo "* soft nproc 65535" >> /etc/security/limits.conf
echo "* hard nproc 65535" >> /etc/security/limits.conf
echo "* soft nofile 65535" >> /etc/security/limits.conf
echo "* hard nofile 65535" >> /etc/security/limits.conf
sed -i 's|'"* soft nproc 1024"'.*|'"#* soft nproc 1024"'|' /etc/security/limits.d/90-nproc.conf
Source: Link Link Link