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

前言

系统:Ubuntu20.04

External file changes sync may be slow: The current inotify(7) watch limit is too low
https://youtrack.jetbrains.com/articles/IDEA-A-2/Inotify-Watches-Limit-Linux

这个报错的意思就是当前设置的默认"watch handle" to be set for each directory in the project,默认是监视句柄达不到系统或者项目需求
在这里插入图片描述

  • 官方建议设置为524288
/etc/sysctl.conf*.confidea.conf/etc/sysctl.d/fs.inotify.max_user_watches = 524288

具体操作步骤

  1. 打开terminal,查看当前设置
$ cat /proc/sys/fs/inotify/max_user_watches

我当前是65536
在这里插入图片描述
2. 在/etc/sysctl.d文件夹下新建60-jetbrains.conf文件

sudo touch /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

  1. 重启系统,并重启IDE
sudo sysctl -p --system

猜你喜欢

转载自blog.csdn.net/qq_41159191/article/details/129970964
今日推荐