Sublime Forum

High CPU and Memory Usage (Sublime 3 PC/Windows 10)


I was prompted to update Sublime 3 earlier today and after doing so noticed immediate latency issues on my machine. In Task Manager I’ve noticed Sublime 3 is utilizing around 70-80% CPU Usage and 5GB of memory. As an additional troubleshooting step I uninstalled/reinstalled the application and have also removed all of my installed packages. My machine has completely frozen up twice now since installing the update.


High CPU on Win10 when an excluded directory has a lot of file create/write/deletes

Did you open an extremely large folder? Is the CPU usage from the background indexer processes?

CPU usage, especially after an update is not unexpected as it reindexes the files in your project using the new syntax definitions. The Help menu has an Indexing Status entry to see if anything is going on there.

Heavy ram usage would usually point towards a misbehaving third-party package, or opening something like the entire hard drive as a folder in the sidebar.


Build 3170 uses up all processor time, as well as loads of RAM

I’m working on Black Ops 4 and use Sublime Text 3 everyday. Extremely large folder? That’s an understatement. 99% cpu usage and my machine finally locked up for over 5 minutes at 43GB of RAM usage, after intermittent lock ups.



That doesn’t sound like it should be happening. Was the UI frozen? Or was it heavy CPU usage related to indexing?

The size of the folder is relative to memory usage just in terms of storing file stat info and file paths. I mean, I have hundreds of thousands of files on a macbook pro from 2013 as my daily driver. However, if you were to index / on a Linux machine, then you are scanning all of the sysfs, procfs stuff, etc.



My folder is ~ 50MB, that doesn’t seem very large. As a test I’ve removed the root folder and added back 3 smaller folders containing the files I actually need to edit so size is now around 1MB. But I’ve always used the source folder for previous projects and never had a single issue until today.

Indexing Status says it indexed 318 files but is idle.

I can confirm the entire hard drive was not in the sidebar, just a single project folder. I have removed all 3rd party packages for now.



From your info I believe it was related to indexing. It was my whole system, when system was responsive the UI was, when the system wasn’t well yeah; I couldn’t open my task manager or (Windows) xkill app to kill it; Ctrl+Alt+Delete didn’t work either. Idk how many files are in my Sublime Text project, but if the indexing is happening on a project level, we have well over 1 million files (almost 1TB), idk how many build generated since I don’t care to isolate and count. Granted I have the folders it’s set to scan to be a select few, so it shouldn’t be going through /that/ many.



It sounds like tweaking the index_workers setting would be in your best interest. They indexing processes should be launching as low-priority, but depending on what else your machine is doing, it could lead to sluggishness.

1 Like


I’ll give that a shot, but now I’m expecting to see RAM climb slowly until there’s none left.

I see there’s some variables related to excluding, like index_exclude_patterns. On our project I think it’d be more useful to have an inclusion filter option, there’s too many filetypes I never want to scan, and comparatively few I do. Anyway, I’ll start trying that out and a few others. Cheers.



What setting do you recommend for index_workers? Mine is currently set to 0.



Well, 0 is generally good. On a 4 core or less machine we will run 2 indexers. On a 5+ core desktop, it will use n-1 indexer by default, where n is the number of CPU cores. If you are seeing too heavy cpu utilization, I would try 2 or 1.



At around 11GB memory usage the UI starts to show a loading icon and I can’t interact with Sublime Text.

[Edit] Actually, at the moment it does that from a fresh open within 10 seconds, when it picks up where it left off.



FWIW indexing does in general scale well to large folders: On my desktop, indexing Chromium (13GB, 250k files, 18M lines of code) takes a few minutes and doesn’t otherwise cause any issues. This is partially file type dependent though: any syntax definitions that trigger the oniguruma slow path (e.g., with backrefs) can take longer to index.

1 Like


Co-worker just mentioned he suspects it’s our virus checker, rather than just Sublime Text’s fault? I’m not sure why that would be, but just throwing out his comment.

[Edit] For now we’re just shutting off file indexing since it seems to get stuck, maximizing our 64GB of RAM.



I could see the big change in behavior on Sublime’s part (reindexing everything all of a sudden) could trigger a virus checker heuristic. That would definitely make sense why everything would get laggy as the virus checker would be blocking requests check to see what is going on.



Wanted to add that by removing the full parent directory from my project, adding back only the folders containing the files I need to edit and adjusting the index_workers from 0 to 1, my cpu and memory issues are back in the normal range. I have always included the parent directory in my projects and never had an issue until recently though so I’m not sure what has changed causing the cpu/memory spikes but at least I can work around it. Thanks for the suggestions.



I have the same issue on Sublime 3 Build 3170 on macOS.

1GiB RAM and 100% CPU. My workspace ~20 windows with several directories per window open contain several GiB of git repos. Probably ~100GiB with binaries (linux-kernel, GCC, GLIBC, QEMU and dozens of other smaller projects).

Thanks to this thread I found Indexing Status… on the Help Menu.

What I would really appreciate as a user is some indication somewhere of background work/progress without needing to search the forum and find some hidden menu item. A little working throbber, spinner or something animated in the status bar, that when clicked brings up the indexer status would be absolutely awesome.

Hope to see a status bar spinner/throbber for background processes in an upcoming build.

Thanks for the great product. I updated to build 3170 about 30 minutes or so minutes ago and its about 70% through my files. Its a fast indexer.



I’m seeing the same thing. Everything was ok with 3.0 (although a bit sluggish given the number of files I have indexed), then upgraded to 3.1 3170 and now CPU and memory are very high for sublime_text.exe (82% on a 16-core machine, using up 12GB out of 32GB). Sometimes it gets to a point where the machine gets unresponsive and I need to close it. This wasn’t a problem before the update.

I also see a few instances of this message in the console: “number of files to index exceeds sanity limit, bailing out”. Again, I don’t remember seeing this message before the update. I see some sort of progress report stuck at 0% at the bottom of the window (status bar?). Help -> Indexing Status says “Indexing” but doesn’t show anything else.



Humm, interesting, I should have looked into this before posting. I found out my project file was pointing to a couple of folders that didn’t exist. Not sure that was the problem, but after fixing them, indexing progress up to 100% somewhat quickly (took maybe 2-3 minutes), then went back to 69%, then completed. After that it showed 0% a couple of times but it seems to be stable now. CPU utilization for the main Sublime process never went past 17% and memory never went above 2GB. It’s in idle now (0% CPU and 385MB). I tried to replicate the problem by editing the project and adding a couple of non-existent folders again but after some activity, CPU and memory utilization went back to normal.

I’ve seen sublime_text.exe increasing CPU and memory utilization while sitting idle. It got up to ~50% and 6-7GB but eventually backed down. I wonder if it will go crazy again if I just let it sit there with the non-existent folders in the project settings. BTW, when it goes crazy there’s only a single sublime_text.exe process, contrary to the regular indexing behavior where indexing processes get spawned up.



Now my indexing status is “idle”, however Sublime Text process went up to ~390% CPU and about ~3.9GiB memory (quad core i7 macbook, build 3170).

I restarted Sublime Text and CPU goes up to 100% and memory is about ~2.5GiB after a couple of minutes.

After restart, Indexing Status says “idle”. There must be some other background work that is not reported.



Indexing Status shows “idle” but my system is getting close to unusable. I guess I have to close all projects (unfortunately I like to have about 20 windows open) and then open them up again one by one to find out which one is causing the CPU usage.