7

In IntelliJ IDEA 13.1.5 on Ubuntu 14.04 LTS I see an occasional error in large projects that says "too many files open". Interestingly, this refuses to go away and freezes the IDE completely. I've tried the following things to fix it.

1) Modify my /etc/sysctl.conf to have this line as shown in this article here. Made the error less frequent:

fs.inotify.max_user_watches = 524288    
fs.file-max = 380180 

2) Raise the ulimit -n setting on the IntelliJ process to 64k. I don't notice any difference in performance with this, but the article that I mentioned above claims that it will help.

3) Add this to my idea64.vmoptions file (helps with speed of indexing, but not with this problem)

-Xms128m
-Xmx8192m
-XX:MaxPermSize=1024m

Has anyone else seen this error and do you have any other suggestions of what I can do to fix it?

I've considering asking IntelliJ support, but I've found I need to go back and forth with them a few times before I get a helpful answer. Any advice from the community on this would be appreciated.

Jason D
  • 8,023
  • 10
  • 33
  • 39
  • I find the IntelliJ community and support to be far more focused and responsive. Try again. I haven't seen that error in > 10 years of using the product. – duffymo Oct 12 '14 at 13:52
  • I'll try them again too, it can't hurt. Just curious if anyone else has other ideas. – Jason D Oct 12 '14 at 13:58
  • 1
    If you are on Mac and getting the same error, here is how to increase the open files limit https://superuser.com/questions/433746/is-there-a-fix-for-the-too-many-open-files-in-system-error-on-os-x-10-7-1/1171028#1171028 or find the culprit https://superuser.com/a/1180084/204758 (same question but different answers) – rvazquezglez Aug 02 '19 at 19:56

1 Answers1

8

I spoke to IntelliJ support. They suggested that part 2 that I mentioned was not taking effect. I tried these steps:

1) sudo vi /etc/security/limits.conf and add these lines (take a backup too):

*       soft    nofile  380180
*       hard    nofile  380180

2) sudo vi /etc/pam.d/common-session add this line (take a backup too):

session required pam_limits.so

3) sudo vi /etc/pam.d/common-session-noninteractive add this line (take a backup too):

session required pam_limits.so

4) Reboot your machine

5) Confirm this took effect by running this command, you should see this result

~$ ulimit -n
380180

I reopened my large project after that and I haven't seen the "too many files open" message since then.

Jason D
  • 8,023
  • 10
  • 33
  • 39