Ubuntu 18.04.2 just after having updated Sublime to 3200.
Similar issue to this:
Sublime appears to be consuming a whopping 6000+ watches (9000+ upon attempting closing all these files and opening two of them in isolation–before opening the files, there are only about 100 watches); I have doubled my systemwide max inotify watches (fs.inotify.max_user_watches) to 16384 to account for the issue. I am still trying to determine exactly which files are being watched and why so many watches are registered. I have no folders or projects open, just 6 lone, unrelated files.
This is a useful utility for tracking inotify use: https://github.com/fatso83/dotfiles/blob/master/utils/scripts/inotify-consumers
This is a one-liner that’ll show all watched files for a process name (replace ‘sublime_text’ with the process name, or replce the whole pgrep invokation with the process id if it’s already known):
(fos=/proc/$(pgrep sublime_text)/fd/* && grep inotify ${fos/fd/fdinfo})
Piping to wc -l will count, and I definitely recommend this if you’ve run out of watches, since the list will be massive (unless some other program is the culprit).
Note that increasing watches is a plausible fix, but for two files open in two large git repos I get 15000+ watches–and opening individual files takes much longer in these repos (presumably because they’re waiting on work in the back end of the application). I am aware this is in part a limitation on inotify (http://man7.org/linux/man-pages/man7/inotify.7.html see the part about requiring subtree watches)–what I’d like to see is some measure to limit the behavior, perhaps just watches on open files, though I realize there may be some feature requirement in the git integration that calls for monitoring the entire repo tree.
Three of the files i have open are part of large git repos; this may explain the issue–however, I do not have any plugins that use git, and disabling the recently added git integration by changing “show_git_status” to false fixes the issue, so it is clearly related to this new feature.
It would be nice if the git integration were only active if, say, the root working directory was the root folder of the open project, or if it could be selectively enabled on a project-by-project basis that would be awesome. Otherwise, doing work in kernel dev, or other hardware-related work, where large repos are the norm, is probably infeasible with this new feature. (I can only image how anyone at Google using Sublime may have reacted on upgrading to 3200…)
TLDR:
Sublime watches lots of git repo files even when unasked; disabling recent git integration fixes the issue; some default limits on this behavior/per-project settings would help.
Thanks! I hope this issue report is helpful either to devs or users. Please let me know if it’d be better placed on github or elsewhere.