Sublime Forum

Sublime consumes cpu on Mac after update

#1

After the most recent update, Sublime is consuming all my cpu on my macbook pro, I’m running build 3200.

3 Likes

Git Savvy package is not working in Sublime Text 3.2
#2

Did you check the indexer status (Help > Indexer Status…)? A bunch of syntax definitions changed, so it needs to reindex your project.

1 Like

#3

Hi @wbond I’m having exactly the same issue since updated to build 3200. Had index_files disabled upon upgrade yet CPU consumption is high. Enabled indexing, let it index, currently indexing is idle, but ST still eats lots of CPU doing nothing. Tried restarting and cleaning up of all sorts, nothing seem to help.

0 Likes

#4

Can you move your data folder and see if the issue persists? https://www.sublimetext.com/docs/3/revert.html

0 Likes

#5

@wbond yeah, sure, will post back as soon as it will finish indexing :ok_hand:

0 Likes

#6

Hi all,

I’ve got the same issue with Linux Mint 18.2 and last build 3200.
Indexing idle and between 40% to 100% CPU doing nothing.
I’ve tried to move data folder : after reindexing all files in my project and return to indexing idle, ST still use 100% CPU.

Thanks in advance for your help.

0 Likes

#7

Just coming in to +1 this, having the same issue since update this morning. Constant 50-60% usage on my Mac 2015.

It’s definitely indexing, because once it finished (idle) CPU started to calm down.

Note, saving a file, the index took 55%-75% to index it for about 5 seconds. Not sure if that’s normal or not.

0 Likes

#8

Note that RAM usage seems also a bit excessive, I’ve got an average 3Go with peak at 5Go.

0 Likes

#9

@wbond no luck, with reverted everything and after indexing is done (crashed at 81% though) ST is still messing with my CPU for no reason. Crash report: https://gist.github.com/nvier/3515fe52fb85a6bef3143f5c4d4c6bc9

UPD: also looking at open files it seem like ST3 does something in ~/Library/Developer/Shared/Documentation/DocSets/ opening and closing files

UPD2: and in my ~/Documents/ o_O

0 Likes

#10

Did you perchance add you entire home directory to the side bar? Or perhaps some other directory that has lots of file writes? If so, that will likely explain the CPU usage.

When you add a folder to the side bar, it monitors it for file changes. If you add something like your home dir, then every file write in your home dir will cause Sublime Text to be notified so it can update its internal catalog of files and folders.

The only reason Sublime Text should ever be reading ~/Library/Developer/ or ~/Documents/ is if you added that dir, or one of their parents to your side bar. I suppose it is possible a rogue plugin could do something like that.

1 Like

#11

Noting a downgrade back to build 3170 has CPU usage back to normal for me when indexing. < 10% indexing ATM.

0 Likes

#12

Can you provide the output of your Console?

0 Likes

#13

Are you sure the 55-75% CPU is related to indexing. Normally indexing a single file that is saved would take on the order of 1s or less, including time to spin up the background indexer.

I am wondering instead if you are working with a Git repository and the activity you are seeing is Sublime refreshing your working copy status?

A copy of your Console contents might be helpful.

0 Likes

#14

Here’s my console output…

startup, version: 3200 linux x64 channel: stable
executable: /opt/sublime_text/sublime_text
working dir: /
packages path: /home/fabien-thomas/.config/sublime-text-3/Packages
state path: /home/fabien-thomas/.config/sublime-text-3/Local
zip path: /opt/sublime_text/Packages
zip path: /home/fabien-thomas/.config/sublime-text-3/Installed Packages
ignored_packages: ["Vintage"]
generating syntax summary
generating meta info summary
pre session restore time: 1.35222
startup time: 1.5121
first paint time: 1.51976
reloading plugin Default.arithmetic
reloading plugin Default.auto_indent_tag
reloading plugin Default.block
reloading plugin Default.colors
reloading plugin Default.comment
reloading plugin Default.convert_color_scheme
reloading plugin Default.convert_syntax
reloading plugin Default.copy_path
reloading plugin Default.detect_indentation
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.indentation
reloading plugin Default.install_package_control
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_context_url
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.profile
reloading plugin Default.quick_panel
reloading plugin Default.rename
reloading plugin Default.run_syntax_tests
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.settings
reloading plugin Default.show_scope_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.ui
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin ShellScript.ShellScript
plugins loaded
git: tracking working dir /home/fabien-thomas
inotify_add_watch failed: Permission non accordée (path: /home/fabien-thomas/.cache/dconf)
inotify_add_watch failed: Permission non accordée (path: /home/fabien-thomas/.cpan/build/Try-Tiny-0.28-rUjlfe/lib)
inotify_add_watch failed: Permission non accordée (path: /home/fabien-thomas/.cpan/build/Try-Tiny-0.28-rUjlfe/maint)
inotify_add_watch failed: Permission non accordée (path: /home/fabien-thomas/.cpan/build/Try-Tiny-0.28-rUjlfe/t)
inotify_add_watch failed: Permission non accordée (path: /home/fabien-thomas/.cpan/build/Try-Tiny-0.28-rUjlfe/xt)

This line makes me wonder if ST is actually scanning all my home dir ?
git: tracking working dir /home/fabien-thomas
FYI, I just open a single file which contain a single line and still 50 to 100% CPU and 3,8Go memory usage.

Thanks for your quick answer by the way. Love your editor.

0 Likes

#15

Yeah, that’s probably not going to work out so well. If you open your home dir, and the whole thing is a Git repo, then every time files change, we re scan the repo to see what the status of files are so we can update the badges in the sidebar. I’m guessing you’ve got a couple of files in there, and probably files that are changing somewhat regularly.

0 Likes

#16

If I try to open my working project (which defines a working_dir and contain lot of files), I’ve got these two lines in console :

git: tracking working dir /home/fabien-thomas
git: tracking working dir /home/fabien-thomas/work/00_git/MY_PROJECT

I don’t know why ST wants to scan my whole home.
Let you know that MY_PROJECT is under git versioning, my home is not. But I’ve got a lot other git project in my home !

Any way to disable Git scanning ?

Update : Oh and my project contains some git submodules too and I got these lines :
git: tracking working dir /home/fabien-thomas/work/00_git/MY_PROJECT/submodules/submodule1
git: tracking working dir /home/fabien-thomas/work/00_git/MY_PROJECT/submodules/submodule2

0 Likes

#17

Do you have a file named /home/fabien-thomas/.git? If so, what is inside of it?

Docs for Git integration are at https://www.sublimetext.com/docs/3/git_integration.html. Ideally I’d love to figure out what is going on, rather than sweeping it under the rug, but I understand if you don’t have time to debug this.

0 Likes

#18

Thanks for your help ! It was that…
I’ve got a .git directory in my home. It was an old project that seems broken because I couldn’t open it with tools like SublimeMerge nor GitKraken.

Since I remove it ST works perfectly.

Thx !

0 Likes

#19

Mac OS Mojave, latest ST3.

Same problem, it seems that full indexing is triggered on every small change and it takes forever. I do not have .git directory in my home. The index status dialog has the following for the really small firebase application and it take 15-20 minute to build the index.

index “xxx” collated in 0.51s from 14810 files
index “xxx” is using 7759360 bytes for 87211 symbols across 435766 locations
indexing [job 22]: indexed 4096 files
indexing [job 22]: spawning 1 workers to process 4096 / 23067 files
indexing [job 21]: indexed 3780 files
indexing [job 21]: spawning 1 workers to process 4096 / 19087 files
indexing [job 25]: indexed 4096 files
indexing [job 25]: spawning 1 workers to process 4096 / 17308 files
indexing [job 22]: indexed 3597 files
indexing [job 22]: spawning 1 workers to process 4096 / 19470 files
indexing [job 21]: indexed 4096 files
indexing [job 21]: spawning 1 workers to process 4096 / 14991 files
indexing [job 25]: indexed 4026 files
indexing [job 25]: spawning 1 workers to process 4096 / 13282 files
indexing [job 22]: indexed 4096 files
indexing [job 22]: spawning 1 workers to process 4096 / 15374 files
indexing [job 21]: indexed 2793 files
indexing [job 21]: spawning 1 workers to process 4096 / 12198 files
indexing [job 25]: indexed 2481 files
indexing [job 25]: spawning 1 workers to process 4096 / 10801 files
indexing [job 22]: indexed 2329 files
indexing [job 22]: spawning 1 workers to process 4096 / 13045 files
indexing [job 21]: indexed 1555 files
indexing [job 21]: spawning 1 workers to process 4096 / 10643 files

0 Likes

#20

Has indexing completed yet? Do you see errors about indexing in your Console?

If you post the contents of your Console, it may help in seeing if something else is going on.

0 Likes