Šim*_*ner 3 watch ulimit node.js
最近我遇到了一个问题。我无法yarn start
在element-web
目录中运行,出现这些错误。本来以为跟element-web
自己有关系,所以就创建了一个问题。一段时间后,我尝试wintersmith preview
在bibviz
目录中运行并遇到相同的错误。这很奇怪,所以我尝试创建一个 Angular 项目并ng serve
再次运行和错误。我前往该问题以关闭它,因为它不是element-web
问题。我发现还有另一个问题是由同样的问题造成的。它已经被关闭的turt2live
说法it looks like you've run out of memory on your system
。基于此,我尝试关闭在后台运行的大多数程序,现在所有命令都可以正常工作。
我确信ng serve
过去曾经工作过。
我的 PC 有 16 GB 的 RAM,当我使用 7/16 GB 时,命令已经失败。运行命令时我看不到任何内存峰值。运行命令sudo
也完全消除了这个问题。这对我来说没有任何意义。
研究引导我,ulimits
但它们似乎没有效果。我也安装watchman
了没有效果。
有人可以告诉我我缺少什么吗?
先感谢您!
我在 Debian 11 Bullseye 上。这是一些可能有用的命令的输出。
作为普通用户:
> uname -a
Linux Simon-s-PC 5.8.0-3-amd64 #1 SMP Debian 5.8.14-1 (2020-10-10) x86_64 GNU/Linux
> sudo sysctl fs.inotify.max_user_watches
fs.inotify.max_user_watches = 524288
> ulimit -a
-t: cpu time (seconds) unlimited
-f: file size (blocks) unlimited
-d: data seg size (kbytes) unlimited
-s: stack size (kbytes) 8192
-c: core file size (blocks) 0
-m: resident set size (kbytes) unlimited
-u: processes 46482
-n: file descriptors 8192
-l: locked-in-memory size (kbytes) unlimited
-v: address space (kbytes) unlimited
-x: file locks unlimited
-i: pending signals 63664
-q: bytes in POSIX msg queues 819200
-e: max nice 0
-r: max rt priority 95
-N 15: unlimited
> yarn --version
1.22.5
Run Code Online (Sandbox Code Playgroud)
与sudo su
:
> sysctl fs.inotify.max_user_watches
fs.inotify.max_user_watches = 524288
> ulimit -a
-t: cpu time (seconds) unlimited
-f: file size (blocks) unlimited
-d: data seg size (kbytes) unlimited
-s: stack size (kbytes) 8192
-c: core file size (blocks) 0
-m: resident set size (kbytes) unlimited
-u: processes 63664
-n: file descriptors 1024
-l: locked-in-memory size (kbytes) 2043392
-v: address space (kbytes) unlimited
-x: file locks unlimited
-i: pending signals 63664
-q: bytes in POSIX msg queues 819200
-e: max nice 0
-r: max rt priority 0
-N 15: unlimited
Run Code Online (Sandbox Code Playgroud)
Šim*_*ner 14
我想我已经找到了解决方案:
/etc/sysctl.conf
通过添加以下内容来设置限制:fs.inotify.max_user_watches=524288
fs.inotify.max_user_instances=512
Run Code Online (Sandbox Code Playgroud)
打开一个新的终端或重新加载sysctl.conf
变量
sudo sysctl --system
Run Code Online (Sandbox Code Playgroud)
跑 yarn start
现在一切正常,希望如此。如果它不起作用,请尝试将限制设置得更高。
归档时间: |
|
查看次数: |
1931 次 |
最近记录: |