20

I am getting two warning messages in IntelliJ IDEA when I am opening my project.

1. IntelliJ IDEA cannot receive filesystem event notifications
for the project. Is it on a network drive?

2. The current inotify(7) watch limit is too low.

NOTE: I am using UBUNTU 20.04 LTS

Warnings Screenshot

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Rwitesh Bera
  • 389
  • 2
  • 3
  • 9
  • 1
    Is the project located on a local directory? Have you checked the https://youtrack.jetbrains.com/articles/IDEA-A-2/Inotify-Watches-Limit ? – Andrey Jun 11 '21 at 10:24

2 Answers2

35

As shared in this link:

Add new conf file..

$ sudo touch /etc/sysctl.d/60-jetbrains.conf

Open the file and add these lines

# Set inotify watch limit high enough for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm).
# Create this file as /etc/sysctl.d/60-jetbrains.conf (Debian, Ubuntu), and
# run `sudo service procps start` or reboot.
# Source: https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
# 
# More information resources:
# -$ man inotify # manpage
# -$ man sysctl.conf # manpage
# -$ cat /proc/sys/fs/inotify/max_user_watches # print current value in use

fs.inotify.max_user_watches = 524288

Let’s restart the system

$ sudo sysctl -p --system
glicerico
  • 690
  • 4
  • 20
  • 1
    Wow! This drastically improved my IDE and PC performance. I think this was effecting my whole PC somehow. – Emre May 05 '22 at 02:26
  • 1
    The output of `cat /proc/sys/fs/inotify/max_user_watches` was `65536`. I tried Menu > *invalidate caches and restart* and seems like it's working fine. – ssi-anik Aug 04 '22 at 09:26
  • But the file /etc/sysctl.d/60-jetbrains.conf is read only, how you changed it – Tefa May 25 '23 at 12:59
  • 1
    @Tefa, by using "sudo" you can open the file in write mode. You have to create it in "sudo mode" as well, as you see in the instructions above. – glicerico May 26 '23 at 13:21
  • Just use sudo vim /etc/sysctl.d/60-jetbrains.conf (or your editor of choice). No need to touch the file beforehand. – MKesper Jun 16 '23 at 08:28
1

For Mac OsX users (My googling bring me here), if your project code is in Google Drive on your internal disk, you'll get this warning as well.

I believe it's because, Google Drive has its own file system(FS) which doesn't implement all features of the FS. (for example, you can't create symlink on a google drive)

Thomas
  • 1,231
  • 14
  • 25