Overview
For an intelligent IDE, it is essential to detect any external changes in project files (e.g., changes from VCS, build tools, or code generators). To achieve this, the IntelliJ Platform runs a background process that monitors file changes.
On Linux, this monitoring relies on the Inotify facility.
Problem
Inotify requires a watch handle for each directory in a project. Large projects can exceed the default watch handle limit. When the limit is reached, the IDE falls back to recursive directory scans, which are slower and less efficient.
Solution
Increase the Inotify watch limit (for example, to 1048576):
-
Create a new
.conffile (e.g.,idea.conf) in the/etc/sysctl.d/directory and add:fs.inotify.max_user_watches = 1048576Some Linux distributions may also configure this setting in a file under
/etc/sysctl.d/or/usr/lib/sysctl.d/(e.g.,/usr/lib/sysctl.d/30-tracker.confunder Ubuntu 24.04 LTS). Files from all these directories are loaded in the order of their filenames, so you may use/etc/sysctl.d/idea.confto override the system-configured setting with a higher-priority one. -
Apply the change by reloading all sysctl configuration files:
sudo sysctl --systemDo not use
sudo sysctl -p --system. Without a file argument,-preads only/etc/sysctl.conf(usually empty on modern distros) and the drop-in file created in step 1 is not applied. If you want to reload only the file you just added, target it explicitly:sudo sysctl -p /etc/sysctl.d/idea.conf. -
Restart the IDE.
💡 Note
- The watch limit is set per user account. If other applications on the same account also rely on Inotify, adjust the limit to accommodate all of them.
Additional information
-
View the current setting:
sysctl fs.inotify.max_user_watches -
Check how many watch handles are currently in use by which process: Stack Overflow answer
-
Learn more about Inotify memory usage: Linux kernel commit
-
If the problem persists (no solution is helpful), please file a new ticket to our tracker, describing your symptoms and which of the above steps you have tried.
Comments
0 comments
Please sign in to leave a comment.