ubuntu14.04/16.06 运行vscode碰到的问题

1, VSCode出现"Visual Studio Code is unable to watch for file changes in this large workspace"警告的解决方法

"Visual Studio Code is unable to watch for file changes in this large workspace" (error ENOSPC)
When you see this notification, it indicates that the VS Code file watcher is running out of handles because the workspace is large and contains many files. The current limit can be viewed by running:
cat /proc/sys/fs/inotify/max_user_watches
The limit can be increased to its maximum by editing /etc/sysctl.conf and adding this line to the end of the file:
fs.inotify.max_user_watches=524288
The new value can then be loaded in by running sudo sysctl -p. Note that Arch Linux works a little differently, view this page for advice.
While 524288 is the maximum number of files that can be watched, if you're in an environment that is particularly memory constrained, you may wish to lower the number. Each file watch takes up 540 bytes (32-bit) or ~1kB (64-bit), so assuming that all 524288 watches are consumed that results in an upper bound of around 256MB (32-bit) or 512MB (64-bit).

解决方法

cat /proc/sys/fs/inotify/max_user_watches
sudo vi /etc/sysctl.conf

在该配置文件的最后一行加上下述语句:

fs.inotify.max_user_watches=81920

让配置文件中的新文件监控数目生效

sudo sysctl -p

输出结果

fs.inotify.max_user_watches = 81920

你可能感兴趣的:(vscode,ide,编辑器)