Inotify Instances Limit (Linux)

For an intelligent IDE, it is essential to be in the know about any external changes in files it working with - e.g. changes made by VCS, or build tools, or code generators, etc. For that reason, the IntelliJ platform spins a background process to monitor such changes. The method it uses is platform-specific, and on Linux, it is the Inotify facility.

Before operating, inotify requires an "instance" to be initialized. While the default per-user limit of instances used to be high enough, a growing number of programs that also use inotify may lead to instance shortage - in which case file watcher will be unable to start.

If this is the case, the limit may be temporarily increased by the following command:

sudo sh -c "echo 256 > /proc/sys/fs/inotify/max_user_instances"

Don't forget to restart the IDE afterward.

4 out of 4 found this helpful
1 comment

This page only documents how to *temporarily* raise the limit.  Here is an article for a persistent solution:

https://www.suse.com/support/kb/doc/?id=000020048

For debian or ubuntu based systems, and probably all the others to:

1) See all current values :

sudo sysctl -a | grep inotify

2) Modify the values in a way that persists after a reboot:

Edit the file /etc/sysctl.conf and add or update these lines:

fs.inotify.max_user_instances=256

fs.inotify.max_user_watches=65536

Then either reboot or apply the values with this command:

sudo sysctl --system

2

Please sign in to leave a comment.

Have more questions?

Submit a request