Sublime Forum

High CPU usage on Mac Sierra with 3143

#41

add this in your settings: "gpu_window_buffer": false, I’m also using DA UI Theme and now it is working like a charm, no more Energy Impact anymore.

1 Like

#42

this problem is very serious , I can hear my mac screaming when I open sublime text3

0 Likes

#43

Unfortunately we still haven’t been able to reproduce this issue. It seems that it is only affecting some user’s configurations. I’ve tried various steps that users have reported to reproduce the issue, but I have been unable to. This leads me to believe the issue is somehow a combination of user configuration and/or hardware.

For everyone who is seeing this issue, could you reply with the following template of information:

  • Sublime Text Build: (e.g. 3143, 3154)
  • Hardware: (e.g. 2016 MacBook Pro w/ Touchar, external 4k display)
  • macOS version: (e.g. 10.12, 10.13)
  • Theme: (e.g. Adaptive, DA, Material, Default)
  • Does the "gpu_window_buffer": false setting help: (e.g. Yes, No)
  • Is the indexer running: (e.g. Yes, No)
  • Does the problem only occur with files open: (e.g. Yes, No)
0 Likes

#44

@wbond,

MacBook Pro (Retina, 15-inch, Mid 2014)
processor:  2.5 GHz Intel Core i7
OS: 10.13.1 (17B48)
Theme: DA
Does the "gpu_window_buffer": false setting help?  no

Is the indexer running?  yes
Does the problem only occur with files open? no

Sublime text3 : 3154

0 Likes

#45

This was an issue with Material Theme for me as well. https://github.com/equinusocio/material-theme

Since this theme is no longer maintained but is one of the most popular themes it might make sense for Sublime to maintain this theme and make it part of the editor.

After switching to VS Code for a couple weeks because of this issue I could not disagree more with the statement on that repo. “This project is not more under active development. Since Sublime Text is an obsolete software compared to other editors”. Issues like this high cpu usage makes sublimetext unusable and for a daily editor that’s not good.

Thanks

0 Likes

#46

I am working on resolving the issue. Here is some more info:

  1. It is a bug in OS X/macOS when using NSOpenGLView combined with a NSFullSizeContentViewWindowMask and your machine switches graphics cards
  2. Unfortunately there doesn’t seem to be a way for us to work around this, so we are having to heavily change the graphics pipeline on macs.
  3. It only happens when you use a theme with the colored title bar and your machine switches from dedicated to integrated graphics, or vice versa
  4. You can work around it by using the Default theme (or any other theme without a colored title bar) or restarting Sublime Text after your machine switches graphics cards.
4 Likes

#47

This is very interesting. I’ll switch to Default for now to avoid the issue. It’s a shame that Apple hasn’t spoken up about the bug.

0 Likes

#48

One of the side effects is that the window also doesn’t call the update method, which can lead to a black or yellow window. That we can use a different notification mechanism to work around, however we weren’t able to come up with a way to avoid the increased CPU usage after the switch.

0 Likes

#49

Ahhhh! I noticed the yellow bug a while back and wondered what caused it. Fascinating.

0 Likes

#50

Worth mentioning: I doubt it has something to do with switching GPUs (I don’t have a dedicated GPU). I think it has something to do with file permissions, as this started happening after I let Disk Utility do a verify and fix on my SSD.
After completely removing Sublime Text (with AppZapper, so all preferences/caches are removed as well) and reinstalling from download, it’s still happening.

0 Likes

#51

Your issue sounds like it is different. We’ve reproduced the CPU issue from GPU switching when the user is using a theme with a colored titled bar.

In your case I’d recommend opening a new topic and including info like:

  1. Does it happen when you have no folders open
  2. Is the indexer running
  3. Provide a process sample via the Activity Monitor (select the Sublime Text process, click the arrow next to the gear button and pick “Sample Process”)
0 Likes

#52

Hi,

I have the same problem and the problem appends when I select to open my personal folder (many files on it).

Thanks

0 Likes

#53

This sounds like a separate issue. My guess would be the indexer has a lot of files to index, and that is what is using the CPU.

0 Likes

#54

Same here on a fresh install with no plugins. Build 3143 running on High Sierra.
I can run SublimeText 2 without any CPU issue… Only ST3. It made me go to VSCode. Really hope that issue will be fixed one day.

0 Likes

#55

The reason for that issue was identified and a first fix for it is included in the latest dev build. But there are still some edge cases to fix which may cause ST to crash.

0 Likes

#56

Apologies for bringing back to life this old s*&t, but yeah, WTF Material Theme?! I put off investigating this for a very long time. Finally did today.

My ST Energy Impact was consistently around ~35. Uninstall Material Theme, now below 5. Farming some Bitcoin are we? Jeeez.

0 Likes

#57

It’s just the way the theme is implemented. It is basically 10 themes merged into one, which means there are multiple “theme rules” for each state of each GUI element. They need to be handled at each draw call thus causing at least higher RAM usage and in most cases more CPU utilization.

I haven’t tried this theme for years now, but the theme engine has been improved since 3143. Maybe the performance impact should be lower these days using an up to date ST3211 - just a guess?!

1 Like

#58

Nah, turns out I can’t blame the theme for this. Switched themes and still have the same issue. It’s the indexer in my case. Specifically because of how our dev envs are setup: network mounts.

Though, what does seem weird is that, the first time I start ST, it goes through its indexing and then it’s fine. It’s not until I reopen my Mac afte it’s been asleep for a while without restarting ST that the indexer seems to get into a weird state that goes on and on forever and that’s what’s cranking up the CPU usage.

Watching the indexer status window shows it start up few jobs for indexing, after a second or so it reports several files indexed, then repeats and this keeps going on or quite some time.

I’m trying to change this setup at the moment. Getting Unison File Synchronizer setup to hopefully stop using the mounts.

0 Likes