打开的文件太多 - 无法初始化inotify:已达到用户对inotify实例总数的限制

时间:2015-08-28 23:46:37

标签: compass-sass inotify

如何解决以下问题?我正在使用指南针。

   Too many open files - Failed to initialize inotify: the user limit on the total number of inotify instances has been reached.
    /home/rmack/Downloads/compass.app/lib/ruby/jruby/rb-inotify-0.9.5/lib/rb-inotify/notifier.rb:64:in `initialize'
    /home/rmack/Downloads/compass.app/lib/ruby/jruby/listen-1.3.1-patched/lib/listen/adapters/linux.rb:66:in `initialize_worker'
    /home/rmack/Downloads/compass.app/lib/ruby/jruby/listen-1.3.1-patched/lib/listen/adapter.rb:87:in `initialize'
    /home/rmack/Downloads/compass.app/lib/ruby/jruby/listen-1.3.1-patched/lib/listen/adapters/linux.rb:31:in `initialize'
    /home/rmack/Downloads/compass.app/lib/ruby/jruby/listen-1.3.1-patched/lib/listen/adapter.rb:226:in `works?'
    /home/rmack/Downloads/compass.app/lib/ruby/jruby/listen-1.3.1-patched/lib/listen/adapter.rb:190:in `usable_and_works?'
org/jruby/RubyEnumerable.java:1425:in `all?'
    /home/rmack/Downloads/compass.app/lib/ruby/jruby/listen-1.3.1-patched/lib/listen/adapter.rb:190:in `usable_and_works?'
    /home/rmack/Downloads/compass.app/lib/ruby/jruby/listen-1.3.1-patched/lib/listen/adapter.rb:57:in `select_and_initialize'
org/jruby/RubyArray.java:1613:in `each'
    /home/rmack/Downloads/compass.app/lib/ruby/jruby/listen-1.3.1-patched/lib/listen/adapter.rb:55:in `select_and_initialize'
    /home/rmack/Downloads/compass.app/lib/ruby/jruby/listen-1.3.1-patched/lib/listen/listener.rb:291:in `initialize_adapter'
    /home/rmack/Downloads/compass.app/lib/ruby/jruby/listen-1.3.1-patched/lib/listen/listener.rb:283:in `setup'
    /home/rmack/Downloads/compass.app/lib/ruby/jruby/listen-1.3.1-patched/lib/listen/listener.rb:65:in `start!'
    /home/rmack/Downloads/compass.app/lib/ruby/compass_1.0/sass-3.4.13/lib/sass/plugin/compiler.rb:405:in `listen_to'
    /home/rmack/Downloads/compass.app/lib/ruby/compass_1.0/sass-3.4.13/lib/sass/plugin/compiler.rb:338:in `watch'
    /home/rmack/Downloads/compass.app/lib/ruby/compass_1.0/compass-1.0.3/lib/compass/sass_compiler.rb:46:in `watch!'
    /home/rmack/Downloads/compass.app/lib/ruby/compass_1.0/compass-1.0.3/lib/compass/commands/watch_project.rb:41:in `perform'
file:/home/rmack/Downloads/compass.app/compass-app.jar!/app_watcher.rb:12:in `watch!'
file:/home/rmack/Downloads/compass.app/compass-app.jar!/ui/tray.rb:447:in `watch'

4 个答案:

答案 0 :(得分:11)

适用于Linux

检查<Alloy> <Window class="container"> <TextField id="username"/> <TextField id="password"/> </Window> </Alloy> 的当前值:

max_user_instances

增加该值:

$ cat /proc/sys/fs/inotify/max_user_instances

为了使该更改永久添加一行到$ echo 256 > /proc/sys/fs/inotify/max_user_instances

/etc/sysctl.conf

答案 1 :(得分:1)

这通常是linux配置问题。 /etc/security/limits.conf中的Increase the number of files open

看起来您正在使用Mac OS,在这种情况下您应该使用sysctl。 Add the following /etc/sysctl.conf

kern.maxfiles=your new value kern.maxfilesperproc=your new value

答案 2 :(得分:0)

如其他注释中所述,您可以尝试查找与文件系统无法正常运行的应用程序。

但是在某些情况下没关系,只有某些应用程序(在我的情况下为Felix OSGI缓存)具有太多打开的文件,并且限制太低。

然后打开phone = input("Phone") digitmap = { 1: "One", 2: "Two", 3: "Three", 4: "Four" } for i in phone: output = digitmap[i] print(output) 并添加带有用户或组限制的行,即:

/etc/security/limits.conf

答案 3 :(得分:0)

为我解决:https://github.com/guard/rb-inotify/issues/23#issuecomment-22997846

# increase inotify file watch limit
ofile=/proc/sys/fs/inotify/max_user_instances
sudo sh -c "echo 8192 > $ofile"
cat $ofile
rerun app.rb