22

I've been using Sublime Text 3 for some time now, and over the past few weeks I've run into an issue where Sublime will spawn numerous processes, eating up 100% of my CPU.

Below is the output of wmic process where "name='sublime_text.exe'"

CommandLine                                                                   ProcessId
"C:\Program Files\Sublime Text 3\sublime_text.exe"                            10980
"/C/Program Files/Sublime Text 3/sublime_text.exe" "--crawl" "10980:crawl:1"  12152
"/C/Program Files/Sublime Text 3/sublime_text.exe" "--crawl" "10980:crawl:1"  8420
"/C/Program Files/Sublime Text 3/sublime_text.exe" "--crawl" "10980:crawl:3"  6016
"/C/Program Files/Sublime Text 3/sublime_text.exe" "--crawl" "10980:crawl:3"  12008

When I open Sublimes console, I see the following lines

worker 8420 appears stuck while processing file /D/dev/project/ext/index.html, killing process
worker 8420 appears stuck while processing file /D/dev/project/ext/build/index.html, killing process

I've since removed the entire /D/dev/project/ext folder from the index, and then I removed it from the project entirey, but that didn't seem to help.

Has anyone seen this before? I'd really rather not do a full re-install of Sublime.

2
  • Just for sake of it, have you tried to delete the entire Sublime Text index database? It's the "Index" directory located in Sublime's data folder (do not forget to close every instances of the editor and ensure its processes are not running anymore).
    – polyvertex
    Mar 25, 2015 at 15:52
  • I did try that, but it didn't work. I was able to figure it out though, I'm writing up the answer now. Thanks for your help
    – ekbarber
    Mar 26, 2015 at 13:22

4 Answers 4

25

You can try this:

shift + super + p:

enter image description here

{
    "color_scheme": "Packages/User/SublimeLinter/Monokai Bright (SL).tmTheme",
    "font_size": 13,

    "folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules/*"],
    "binary_file_patterns": ["*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"],
}

references:

Limit File Search Scope in Sublime Text 2

14

It may be the case that you have opened a project which contains 3rd party libraries.

In my particular case I have this kind of problem if I do not exclude from Project Index node_modules directory of some bigger node.js application.

Sublime Text tries to refresh index files on each run.

Add exclude pattern in your Project:

"folder_exclude_patterns":
[
    "DIR_NAME"
]

1
  • didn't see to help that much..? Mar 18, 2016 at 17:24
12

I have had this question come up several times so I'd like to give a more complete answer.

What are they and how do I stop them?

The processes you see are the indexing workers which are parsing all of the files included in the side bar of your project(s) (yes, every single file) and building an index for Goto Anything. See Sublime Text 3 File Indexing.

Disabling All Indexing

This can be completely disabled by adding "index_files": false, to your Preferences.sublime-settings (Prefereces > Settings). To disable this system-wide, you add it to your Default settings file, or you can add it to your User setting file. Either will work.

Limiting the Scope of Indexing

However, if you would rather not disable indexing entirely, you can simply modify the scope of the files that are excluded from indexing:

(this is a good starting list, but feel free to edit to better fit your needs)

"index_exclude_patterns": [
    "data/*",
    "log/*",
    "logs/*",
    "node_modules/*",
    "vendor/*",
    "*.log"
]

Additionally, you might also want to expand what is considered a "binary" file (binaries are also excluded from indexing):

"binary_file_patterns": [
    "*.bz2",
    "*.cache",
    "*.dds",
    "*.eot",
    "*.gif",
    "*.gz",
    "*.ico",
    "*.jar",
    "*.jpeg",
    "*.jpg",
    "*.pdf",
    "*.png",
    "*.swf",
    "*.tar",
    "*.tga",
    "*.ttf",
    "*.zip"
]

I have seen people suggest adding folders to the folder_exclude_patterns array, but that is the list of folders to hide from display in the side bar. While folders not displayed in the side bar will not be indexed, there might be files or folders that you do want displayed but don't want indexed; in such cases index_exclude_patterns should be used.

Limiting Indexing Per Project

Indexing exclusions can also be defined per project in the *.sublime-project file:

{
  "folders":
  [
    {
      "path": "src",
      "folder_exclude_patterns": ["vendor"]
    },
    {
      "path": "doc",
      "index_exclude_patterns": ["*.md"]
    }
  ]
}

Limiting the Number of Indexing Worker Processes

It is also worth noting that you can limit the number of indexing worker processes with "index_workers": 1, where 1 is the number of worker processes. By default that number is 0 which instructs Sublime to guess and the optimal number of workers based on the number of CPU cores available.

2
  • 1
    For those who've installed Steam on ubuntu and installed a bunch of games: add .local or .local/Steam to your exclude patterns
    – KdgDev
    Oct 11, 2019 at 22:26
  • Yes, KdgDev, good point. I don't usually have Sublime crawling my entire home folder, but you would absolutely not want Sublime trying to index game files. Thanks! Nov 27, 2019 at 16:35
2

Removing the folder containing those two problem files did do the trick afterall, but only after I also removed the Javatar plugin. I've since added the Javatar plugin back, and I haven't add issues since, so if I were to guess is that when I removed the files project and restarted Sublime, the Javatar plugin still knew about them and was telling Sublime to index them. Once I uninstalled and reinstalled the Javatar plugin, after the files had been removed, everything seemed to work fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.