25 August 2018 | 1 min read

External file changes sync slow: The current inotify limit is too low

I get this message when waiting gradle task on my Android Studio 3

External file changes sync may be slow: The current inotify(7) watch limit is too low

WTF is this? After some google-fu , I found some official instruction from JetBrain. You can read here for more details.

Now, let’s check the current setting:

$ cat /proc/sys/fs/inotify/max_user_watches
8192

Does the current value are too small? Add new conf file..

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

Open the file and add this 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 systemd

$ sudo sysctl -p --system

Now, restart you IDE. It should be no complaint anymore ;d

Robbi Nespu | Bash, Code, IDE, Linux, Sysadmin


Discussion and feedback