Sublime Forum

Mitigating the 3176 crash / cpu overload

#1

I’ve been experiencing the issue ever since I upgraded to 3176, and I’ve tried multiple things to mitigate it, without success. I’ve disabled plugins, removed all the plugins, etc.

Even after wiping out the ~/Library/Application Support/Sublime Text 3 it lagged and ran my CPU into 200-300% range. Main symptom was lag and very slow sidebar scroll.

I’ve noticed that fresh projects were working fine, but issue occurred every time I loaded a project created with previous version of ST3. Rebuilding the project and workspace files from scratch removed the issue, so I presume there’s a problem with parsing the old project files properly.

Hope this helps others too.

0 Likes

#2

Nope. Sorry about the disinformation. It was short lived. Still having issues with plain ST3 (no Library files) and rebuilt project files. I’m even experiencing glitching with render (like the GPU is struggling) visible in blinking of the whole screen with glitchy graphics.

0 Likes

#3

Btw, this is on latest HighSierra, on the latest MacBook Pro 13inch

0 Likes

#4

The problem persists in 3180 too.

0 Likes

#5

Have you tried playing with the gpu_window_buffer setting?

0 Likes

#6

Looks like the culprit might be the indexing node_modules even though I’m skipping it in preferences.
When I remove it, the CPU usage drops to regular 15-20% on average. As soon as I install it (npm i) the ST starts indexing, ignoring my binary_file_patterns; ["node_modules/**"] and index_exclude_patterns: ["node_modules/**"]

0 Likes

#7

If that is the case, the indexing should subside after a little while, and you shouldn’t need to deal with it again until your syntax definitions are changed. You can also use the Help > Indexing Status… menu to open the index status window to see what is going on.

0 Likes

#8

Thank you for the info, but it’s not index either, it seems. The CPU drops on occasion, but as soon as I try to scroll anything, it crawls to a halt (200%+)

gpu_window_buffer values don’t change the behavior

Anything else I can try to delete? :slight_smile:

0 Likes

#9

Removing node_modules makes it run ok. Kinda like the traversal of a large tree is an issue.

0 Likes

#10

So is the scrolling only an issue in the sidebar?

0 Likes

#11

It affects both main screen and the sidebar. Typing is also slowed down / very laggy when it’s running high.

I’m trying to consistently replicate the issue. I’ll post here if I manage to do so.

0 Likes

#12

When you see it happen, can you use the Activity Monitor and click (Gear) > Sample Process for the Sublime Text process?

0 Likes

#13

Here it is

0 Likes

#14

Hmm, do you have a bunch of filesystem activity going on within the folder you have open? Such as files being created, modified or removed? I see a bunch of calls to code handling changes in the folder structure.

0 Likes

#15

Couldn’t replicate the issue on my other mac (2015 Macbook Pro, Mojave, 3180), but I think your comment gave me some insight:

The issue is happening on my work computer, which has Palo Alto Networks Trap Endpoint Protection installed, and looks like it might be interfering with ST filesystem reads/writes. I can’t disable it, so I can’t confirm 100%

The unusual part is that I ran it without issues until the 3176 update (if I remember correctly)

0 Likes

#16

Tried reverting to 3170, but the issue remains. Tested 3180 against the same folder on my mac without the security agent, and no issues there. The node_modules has about 43K+ files. Removing it, things speed up back to normal.

I’m lost. I guess I won’t be able to use it on my work machine. :frowning:

0 Likes

#17

The closest I got to replicating reliably so far is an empty directory with node_modules copied from another project. No other project files or so, just a directory structure of node_modules. Once the number of files reaches 100K, the real slowdown starts, but even at ~80K files, the usage is at about 90%. This is with no files open, just a subl . in a directory that contains only node_modules with files.

I’m still waiting to hear from my company tech support to see if we can turn of Trap to see if that’s causing the issue.

BTW, this is with index_files: false.

0 Likes

#18

…aaaaand after restarting my Mac yet again, the issue is gone now. :frowning:

Sorry to anyone reading this mess.

0 Likes

#19

Finally got it to behave nicely with:

{
  "folder_exclude_patterns": [ "node_modules"]
}
1 Like

#20

NB: I’m not sure when it happened, but I’ve been noticing that projects that have node_modules potentially in them take a huge amount of time to index recently as well.

I have been excluding these folders from the project, but I’m wondering if the code has changed, so that indexing ignores folder_exclude_settings and now just cares about index_exclude?

That would explain why, even though I’ve excluded visually a bunch of bad files from my projects, things are still very slow to index.

0 Likes