3

I have a process (java program)that require many temporary files. There is limit set that we cannot have more than 1024 open descriptors. How do I increase "open files" limit for process from 1024 to 10240 I can reduce the value.. not increase it. The following works.

ulimit -n 899 

The following does not work

ulimit -n 1025
2
  • If you "need" to have that many temp files open all at the same time you're probably doing it wrong™
    – Chris S
    Oct 15, 2010 at 12:28
  • Agree. 'definitely' wrong.
    – Jayan
    Oct 22, 2010 at 4:22

1 Answer 1

6

You will need root access to increase it. If you're using Ubuntu (also works for other distros): http://ubuntuforums.org/archive/index.php/t-521287.html

If you're using bash, the command is 'ulimit -n'. To change the limit permanently edit /etc/security/limits.conf (your distro may use a different location).

For a list of all options, use -a:

$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 20
file size               (blocks, -f) unlimited
pending signals                 (-i) 16382
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) unlimited
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
2
  • It works to reduce the value- -- cannot increase from my use account (Thanks, I update the question)
    – Jayan
    Oct 13, 2010 at 10:28
  • That works in many linux flavours. Could you write that as answer :)
    – Jayan
    Oct 14, 2010 at 4:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .