背景:Ubuntu上安装Android Studio查看aosp源码目录,每次打开的时候编译器都会提示
External file changes sync may be slow: The current inotify(7) watch limit is too low. More details.
翻译过来的意思是:外部文件更改同步可能很慢:当前的 inotify(7) 监视限制太低。更多细节。
记录下解决方法:
- 在
/etc/sysctl.d文件夹下新建60-jetbrains.conf文件 - 在
60-jetbrains.conf文件中添加下列内容
# 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
3.重新启动systemd
sudo sysctl -p --system
4.重启IDEA