Sublime Forum

INotify Count Crashing System

#1

ST4 is wholly unusable on ubuntu recently. If I have more than one window open, my INotify count is in the hundreds of thousands, and my 64GB system hangs or crashes. It’s become completely unusable as a development tool.

I’ve attempted to turn off git integrations, disable as much extra crap as possible to no avail. I don’t remember when I had a system run as slow and chunky as Eclipse.

I need some sort of solution, as Sublime has been my main editor for years, but it’s about to become unusable and permanently removed from my system if I can’t open it without it hanging everything else for a solid minute or two.

It even crashes my docker containers due to the massive overwhelming INotify flood. Why does it do this even remotely?

0 Likes

#2

inotify is used to track changes in the folders you have open. Have you opened your home folder in the side bar or something along those lines?

0 Likes

#3

No - and even if I had, having there be 7 instances of sublime-text holding 50k INotify watches is more the issue.

I’d post the replicated instances, but the markup for this forum is kind of busted? Unsure how to do it without mangling the text almost as bad as my system is from this.

There’s multiple command instances like

  • /opt/sublime_text/sublime_text --detached
  • /opt/sublime_text/plugin_host-3.8 179337 /opt/sublime_text/sublime_text /home/user/.config/sublime-text /home/user/.cache/sublime-text /opt/sublime_text/Packages
  • /opt/sublime_text/sublime_text --crawl 179337:crawl:1 /home/user/.config/sublime-text /home/user/.cache/sublime-text /opt/sublime_text/Packages

I tried removing the cache manually, re-installing fresh, and each time with zero luck. The second I open any set of directories, my system hangs immensely. This is on just a basic go project with maybe 3-4 directory layers.

Edit: I apologize for the super-apparent frustration, I’ve been having to bang head against this all day, and it was difficult even just getting to a point of being able to make a technical ticket. So, thank you.

0 Likes

#4

No - and even if I had, having there be 7 instances of sublime-text holding 50k INotify watches is more the issue.

An inotify watch is required for each watched folder with symlinks being followed. This includes opened folders as well as ST packages and others.

I’d post the replicated instances, but the markup for this forum is kind of busted? Unsure how to do it without mangling the text almost as bad as my system is from this.

The forum uses standard markdown. If you want to dump text verbatim use ```.

Have you tried safe mode?

0 Likes

#5

So then how do I turn that off? And why is it creating tens of thousands in multiple instances for a project of 700 files?

I appreciate the markdown advice, but it does feel a bit skirting the issue. However, what I can give:

    COUNT     PID USER     COMMAND
--------------------------------------
   20541   179337 user /opt/sublime_text/sublime_text --detached
   20540   182068 user /opt/sublime_text/sublime_text --crawl 179337:crawl:1 /home/user/.config/sublime-text /home/user/.cache/sublime-text /opt/sublime_text/Packages
   20540   182067 user /opt/sublime_text/sublime_text --crawl 179337:crawl:1 /home/user/.config/sublime-text /home/user/.cache/sublime-text /opt/sublime_text/Packages
   20540   182066 user /opt/sublime_text/sublime_text --crawl 179337:crawl:1 /home/user/.config/sublime-text /home/user/.cache/sublime-text /opt/sublime_text/Packages
   20540   182065 user /opt/sublime_text/sublime_text --crawl 179337:crawl:1 /home/user/.config/sublime-text /home/user/.cache/sublime-text /opt/sublime_text/Packages
   20540   182064 user /opt/sublime_text/sublime_text --crawl 179337:crawl:1 /home/user/.config/sublime-text /home/user/.cache/sublime-text /opt/sublime_text/Packages
   20540   179409 user /opt/sublime_text/plugin_host-3.8 179337 /opt/sublime_text/sublime_text /home/user/.config/sublime-text /home/user/.cache/sublime-text /opt/sublime_text/Packages
   20540   179406 user /opt/sublime_text/plugin_host-3.3 179337 /opt/sublime_text/sublime_text /home/user/.config/sublime-text /home/user/.cache/sublime-text /opt/sublime_text/Packages

No, but how does that address the issue at hand? Does that mean I can only use safe mode?

Also, as of that dump above, I had zero files open. I simply opened a folder and started clicking expand on the directory structure, and then my system hung for about 20 seconds, and the script to grab the INotify count also took far longer than it should. It full-spikes my CPU. Again, on a directory structure with maybe 4 layers and a couple-dozen folders, maximum 700 files including packages.

0 Likes

#6

Attempted in safe mode, I’m still getting the same massive INotify counts across multiple instances. It’s less duplicated crawler instances than before, but it’s still far and beyond anything else or should be.

    COUNT     PID USER     COMMAND
--------------------------------------
   20544   191817 user /opt/sublime_text/sublime_text --detached --fwdargv0 /usr/bin/subl --safe-mode
   20540   191884 user /opt/sublime_text/plugin_host-3.8 191817 /opt/sublime_text/sublime_text /home/user/.config/sublime-text-safe-mode /home/user/.cache/sublime-text-safe-mode /opt/sublime_text/Pac
   20540   191881 user /opt/sublime_text/plugin_host-3.3 191817 /opt/sublime_text/sublime_text /home/user/.config/sublime-text-safe-mode /home/user/.cache/sublime-text-safe-mode /opt/sublime_text/Pac

Edit: Tried a much smaller directory structure, something with 10 files and 4 directories - it hung even worse, I assume because it hadn’t yet seen said directories yet, but it’s in the millions, and my system froze for a minute or two there. Almost couldn’t c+p this without everything crashing.

    COUNT     PID USER     COMMAND
--------------------------------------
  910112   193106 user /opt/sublime_text/plugin_host-3.8 193039 /opt/sublime_text/sublime_text /home/user/.config/sublime-text-safe-mode /home/user/.cache/sublime-text-safe-mode /opt/sublime_text/Pac
  909325   193103 user /opt/sublime_text/plugin_host-3.3 193039 /opt/sublime_text/sublime_text /home/user/.config/sublime-text-safe-mode /home/user/.cache/sublime-text-safe-mode /opt/sublime_text/Pac
  908550   193039 user /opt/sublime_text/sublime_text --detached --fwdargv0 /usr/bin/subl --safe-mode
0 Likes

#7

Safe mode lets you check whether the problem is inherent to ST or caused by your configuration or packages you’ve installed.

ST will index all files in folders you open to provide auto-complete and goto-anything functionality. You can disable this but it shouldn’t be causing any lockups. You can check the indexing status under Help > Indexing Status….

0 Likes

#8

This issue only started recently when I updated Sublime. I’ve been a licensed user for the last year or so, I’m going to go off a limb here and say that the only thing that changed was me moving to ST4.

If it causes my system to hang worse than a normal file crawler, in safe mode, this is something wrong with the program. It’s also not the indexing - it claims it’s completed, but my inotify count keeps climbing. It’s now at 1.6M counts per Sublime instance - that’s in the PID count, not in the instances I have running, which right now is a single one pointing to an incredibly simple file directory structure.

0 Likes

#9

But that’s exactly why I’ve made this ticket? How do I disable this?

0 Likes

#10

How do I disable this?

See the "index_files" setting, but that doesn’t affect inotify watches.

If it causes my system to hang worse than a normal file crawler, in safe mode , this is something wrong with the program.

To clarify, have you checked whether this problem still happens in safe mode?

0 Likes

#11

Additionally can you also provide the exact version you’re using (Help > About Sublime Text).

0 Likes

#12

Yes, as stated in the post I’m quoting above. My post above about the 1.6M count is while the system is still in safe mode.

0 Likes

#13

The system or Sublime Text? ST safe mode is unrelated to your system’s safe mode.

0 Likes

#14

Build 4126, I just did multiple clean re-installs through apt-get to try and troubleshoot this before I made a ticket.

0 Likes

#15

Sublime Text. You can see it in the process outputs that I’m running with the --safe-mode flag.

0 Likes

#16

Could you run find . -type d | wc -l inside the directory you’re opening?

0 Likes

#17

Alright, that does make sense - the inofity count is about-matching the wc -l output.

However, this is something that just started recently, and needs to be able to be disabled. How can that be done? I’ve always had my directories open from a fairly high level, and it doesn’t make sense that it would need to hold an INotify for every existing file.

0 Likes

#18

That command lists only the folders not the files. There is no way to disable this as it’s required to track changes to the folder you have open, might as well not open the folder and avoid it that way.

What might be the case is that you have a symlink that points to a larger tree. If you do you can easily remove it from being tracked by using the "folder_exclude_patterns" setting.

0 Likes

#19

That’s not going to be acceptable. Even in the case of the 20k folders in a project (which is not uncommon by any means due to package managers, git subdirectories and etc.), there needs to be a way for me to continue to use the same directory view that I’ve been using Sublime Text for years for, or I’ll need to find a way to get a license refund due to the product no longer being usable.

There has to be a way to disable that inotify count. I have tried other editors that do not have this issue in the slightest. Otherwise if there’s no way to disable the absurd amount of inotify entries the program creates unless I significantly change the user flow I was previously using the program for, then from my standpoint it’s no longer a usable program.

0 Likes

#20

ST has always used inotify on all folders, this hasn’t changed and it’s literally the only way to track changes. The only thing that’s changed recently is how symlinks are handled as they’re now only deduplicated when a loop is detected. 1.4 million is very far away from 20k, perhaps you have a lot of symlinks that aren’t leading to loops? Would a depth limit help in your case?

0 Likes