I plan to run a Java app using
nohup ... &. The limit must apply to commands like this.
Most systems use PAM, and have the
pam_limits module set limits based on
/etc/security/limits.conf. The per-user limit for open files is called
nofile. You can set it for every user or for a particular user or group, and you can set a limit that the user can override (soft limit) and another that only root can override (hard limit). The documentation and the
limits.conf man page have the details. For example, to raise the limit to 50000 for everyone, put this line in
/etc/limits.conf (the setting takes effect when you log in):
* - nofile 50000
you can add
fs.file-max = <your number> into
/etc/sysctl.conf. Then reboot.
can modify per process settings and
or the sysctl variable called
fs.file-max can be used to read and set the system-wide value
You can use ulimit for this:
Although you should make sure that opening so many file handles is absolutely necessary before resorting to such adjustments. Increasing the maximum file handles just because you have forgotten to do an inputstream.close() in a loop is only going to delay the underlying problem.
vi ~/.bashrc And add a line at the end of file
ulimit -n 169203
Use ulimit(Bash command - man bash or find similar for your shell) per program instance. Do not use global system limits if you don't know what are you doing - possible DoS.