Eclipse – “Too many open files” Problem

If your OS is Linux and you are using Eclipse, you might possibly see the following error messages or similar on certain time. This may result by installing many plugin or other reasons.
This is because there are too many files opened and these are more files than the number of open files allowed . So Eclipse cannot open more files and displays the errors above.
Let’s see the number of open files.
$ lsof | wc -l

e.g.)

$ lsof | wc -l
9028

In my case, it was 9028.

Now check the limitation of open files

Now check the limitation of open files
$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 31226
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) 31226
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

To change it, open the file /etc/security/limits.conf and put a greater number than 1024 depending on the number of open files you checked with lsof | wc -l just before.
For example,
Open the file
$ gksudo gedit /etc/security/limits.conf
add these lines
*                soft    nofile          9216

*                hard    nofile          9216

Log out and in then check with ulimit. It should show like this.
For more detail view in below page,

Source: http://blog.lckymn.com/2009/08/11/eclipse-too-many-open-files-problem/comment-page-1/

Leave a Reply

Your email address will not be published. Required fields are marked *