Every time on start Android studio displays a warning.
The current inotify(7) watch limit is too low.
I don't understand what it is all about. Should I be worried about it ? If anyone can clear about the concept of this watch limit I would be very thankful .
inotify requires kernel resources (memory and processor) for each file it tracks. As a result, the Linux kernel limits the number of file watchers that each user can register. The default settings vary according to the host system distribution; on Ubuntu 20.04 LTS, the default limit is 8,192 watches per instance.
inotify. max_user_watches define user limits on the number of inotify resources and inotify file watches. If these limits are reached, you may experience processes failing with error messages related to the limits, for example: ENOSPC: System limit for number of file watchers reached...
According to the IntelliJ documentation,
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, IntelliJ platform spins background process to monitor such changes.
Inotify requires a "watch handle" to be set for each directory in the project. Unfortunately, the default limit of watch handles may not be enough for reasonably sized projects, and reaching the limit will force IntelliJ platform to fall back to recursive scans of directory trees.
Therefore, you need to add
fs.inotify.max_user_watches = 524288
in "/etc/sysctl.conf"
and then run the following command for it to take effect
sudo sysctl -p
Let me know if this helps !
Here's the clean and easy copy-and-paste fix:
Simply copy-and-paste this multi-line command into your shell. It will create the file /etc/sysctl.d/android-studio.conf
which will apply the necessary inotify limits upon every system startup:
cat << EOF | sudo tee /etc/sysctl.d/android-studio.conf # Increase inotify limit, required by Android Studio, https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit fs.inotify.max_user_watches = 524288 EOF
Reload your new sysclt configuration file (and all the others):
sudo sysctl -p --system
Restart Android Studio.
Here's the IntelliJ documentation for completeness: https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With