Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExtensionHost CPU usage goes up to 100% when enabling this extension #185

Closed
felipekb opened this issue Dec 11, 2020 · 40 comments
Closed

ExtensionHost CPU usage goes up to 100% when enabling this extension #185

felipekb opened this issue Dec 11, 2020 · 40 comments

Comments

@felipekb
Copy link

felipekb commented Dec 11, 2020

I've noticed that the CPU usage with this extension increases the CPU usage by a lot.

Tested by disabling it, got average numbers after that.

Here's the output of running code --status.

OS Version:       Darwin x64 20.1.0
CPUs:             Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz (8 x 1400)
Memory (System):  16.00GB (0.05GB free)
Load (avg):       4, 5, 5
VM:               0%
Screen Reader:    no
Process Argv:     . --crash-reporter-id ea953996-6f81-411f-ab56-0ceed96dff61
GPU Status:       2d_canvas:                  enabled
                  flash_3d:                   enabled
                  flash_stage3d:              enabled
                  flash_stage3d_baseline:     enabled
                  gpu_compositing:            enabled
                  metal:                      disabled_off
                  multiple_raster_threads:    enabled_on
                  oop_rasterization:          enabled
                  opengl:                     enabled_on
                  protected_video_decode:     unavailable_off
                  rasterization:              enabled
                  skia_renderer:              disabled_off_ok
                  video_decode:               enabled
                  webgl:                      enabled
                  webgl2:                     enabled

CPU %	Mem MB	   PID	Process
    0	    82	 54085	code main
    0	    49	 54096	   gpu-process
    0	    16	 54098	   utility
   90	    82	 54104	   shared-process
    0	     0	 54519	     /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
    1	   180	 54255	   window (update.rb — nanno-web)
  110	   115	 54257	     extensionHost
    0	    16	 54267	       electron_node server.js
    0	    33	 54261	     watcherService
    0	    16	 54263	     searchService```
@felipekb felipekb changed the title ExtensionHost CPU usage goes up to 100% usage when enabling this extension ExtensionHost CPU usage goes up to 100% when enabling this extension Dec 11, 2020
@davisben
Copy link

I am experiencing the same behavior. Disabling the extension returns the CPU usage to normal.

@ecmel
Copy link
Owner

ecmel commented Dec 12, 2020

Is it high for startup or all the time?

@felipekb
Copy link
Author

At all the time 🙃

@ecmel
Copy link
Owner

ecmel commented Dec 12, 2020

I am developing the extension on Windows 10 with WSL2 and my extension_host CPU usage is zero when idle.

@davisben
Copy link

I'm on MacOS 11.0.1. It stays at 100% until the extension is disabled.

@ecmel ecmel added the upstream label Dec 13, 2020
@tonix-tuft
Copy link

Hello guys I have the same issue. 100% CPU usage when this extension is enabled.

I have disabled the extension for now.

Let me know when this issue is fixed cause I like this extension.

Cheers!

@ecmel
Copy link
Owner

ecmel commented Dec 13, 2020

@tonix-tuft Are you on MacOS?

@tonix-tuft
Copy link

@ecmel Yes.

@ecmel
Copy link
Owner

ecmel commented Dec 13, 2020

Can be related to paulmillr/chokidar#447

@ecmel
Copy link
Owner

ecmel commented Dec 13, 2020

@felipekb @davisben @tonix-tuft Could you please try version 1.1.4?

@tonix-tuft
Copy link

OK

@tonix-tuft
Copy link

Nope man, same issue for me 😢

312a9977712164959c4596d5164f2e45

26a2aaf94791f8c4b0be0c08dbc224f3

@ecmel
Copy link
Owner

ecmel commented Dec 13, 2020

For reference Windows 10 with WSL 2:

Version:          Code 1.52.0 (940b5f4bb5fa47866a54529ed759d95d09ee80be, 2020-12-10T22:45:11.850Z)
OS Version:       Windows_NT x64 10.0.19042
CPUs:             Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 x 1992)
Memory (System):  15.81GB (7.08GB free)
VM:               0%
Screen Reader:    no
Process Argv:     --crash-reporter-id e6ce3f6e-cb76-49e1-8436-b2f5d71f705f
GPU Status:       2d_canvas:                  enabled
                  flash_3d:                   enabled
                  flash_stage3d:              enabled
                  flash_stage3d_baseline:     enabled
                  gpu_compositing:            enabled
                  multiple_raster_threads:    enabled_on
                  oop_rasterization:          disabled_off
                  opengl:                     enabled_on
                  protected_video_decode:     enabled
                  rasterization:              enabled
                  skia_renderer:              disabled_off_ok
                  video_decode:               enabled
                  vulkan:                     disabled_off
                  webgl:                      enabled
                  webgl2:                     enabled

CPU %   Mem MB     PID  Process
    0       93    5060  code main
    0      189    4048     window (vscode-html-css [WSL: Ubuntu-20.04] - Visual Studio Code)
    0       94   16296       extensionHost
    0       64   21416         electron_node wslDaemon.js
    0       55    5828     crashpad-handler
    0       62    6884     utility
    0      108   13692     shared-process
    0      282   18048     gpu-process

Remote:           WSL: Ubuntu-20.04
OS Version:       Linux x64 4.19.128-microsoft-standard
CPUs:             Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 x 1992)
Memory (System):  12.34GB (10.56GB free)
VM:               0%
CPU %   Mem MB     PID  Process
    0        0   22506  remote agent
    0        0   22743     watcherService
    0        0   22754     extensionHost
    0        0   22806     /bin/sh -c /usr/bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
    0        0   22807       /usr/bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=

@tonix-tuft
Copy link

I don't know man, this is what I see on my Mac, something you can advise me to try in order to help further troubleshoot this issue?

@felipekb
Copy link
Author

It seems to be working fine now!

Thanks 👏
image

@davisben
Copy link

I'm still seeing 100% with 1.1.4.

@tonix-tuft
Copy link

@davisben Same for me.

@tonix-tuft
Copy link

@felipekb Are you on OS X?

@ecmel
Copy link
Owner

ecmel commented Dec 14, 2020

@davisben @tonix-tuft Can you please try with "css.watcherEnabled": false setting in the 1.1.5 version?

@johnnywo
Copy link

same here MacOs Catalina 10.15.7

@ecmel ecmel reopened this Dec 14, 2020
@felipekb
Copy link
Author

@tonix-tuft Yes, Im running OS X 11.0.1

@tonix-tuft
Copy link

tonix-tuft commented Dec 14, 2020

@ecmel OK, it works with "css.watcherEnabled": false, no CPU spikes.

Is there a way to disable this extension on a per-file basis? E.g. like Prettier does with // prettier-ignore?

I have a huge HTML file with some dumped data, maybe it's because of that...

@ecmel
Copy link
Owner

ecmel commented Dec 14, 2020

@tonix-tuft Where is your CSS? Are you using local or remote css? If remote then you dont have to enable watch setting

@tonix-tuft
Copy link

@ecmel It's local.

@ecmel
Copy link
Owner

ecmel commented Dec 14, 2020

@tonix-tuft You can enter absolute file names to css.ignoredFolders

"css.ignoredFolders": [
  "**/node_modules/**"
]

@pilgunboris
Copy link

The same started happening to me today after the recent update of VScode (current version is 1.52.0).
Current extension version: v1.1.5

Setting "css.watcherEnabled": false or disabling the extension resolves the issue.

Also, I had this previously:

"css.ignoredFolders": [
  "**/node_modules/**"
]

and it was still up to 300% CPU usage if that's helpful.

I'm on macOS 11.0.1.

@tonix-tuft
Copy link

@ecmel

@tonix-tuft You can enter absolute file names to css.ignoredFolders

How can I do this on a per-project basis? Can I put it in a project'ssettings.json file?

@ecmel
Copy link
Owner

ecmel commented Dec 15, 2020

@tonix-tuft Yes

@tautologistics
Copy link

Confirming that pegged processor is resolved with setting "css.watcherEnabled": false.
Observed the aberrant behavior with every permutation of the following:

  • OS: OSX 11.0 & 11.1
  • VS Code: 1.51 & 1.52
  • HTML CSS Support: 1.1.4 & 1.1.5

All source files are local...

@shaal
Copy link

shaal commented Dec 15, 2020

I have the same problem, on a MacBook Pro Catalina, VScode Insiders, CPU usage 100% when this extension is enabled :(

@ecmel
Copy link
Owner

ecmel commented Dec 15, 2020

Upstream bug reports:

paulmillr/chokidar#859
paulmillr/chokidar#873
paulmillr/chokidar#447

All seems to be resolved. Will open a new issue.

@ecmel ecmel added the bug label Dec 15, 2020
@ecmel
Copy link
Owner

ecmel commented Dec 16, 2020

Anybody tried 1.1.6?

@tautologistics
Copy link

Just restarted the computer for unrelated reasons. Tried re-enabling css.watcherEnabled and the pegged CPU is back.

OSX: 11.1
VS Code: 1.52.1
HTML CSS Support: 1.1.6

image

I know, it's not easy to diagnose and resolve someone else's issues asynchronously, but I do appreciate the effort you've put into creating/maintaining this extension and for looking into this issue. In the big picture, it's not a big deal because there's at least a means to mitigate the issue for now by disabling css.watcherEnabled.

@tonix-tuft
Copy link

Could it be related to VS Code's 1.52.0 minor version bump? What do you think guys?

@tautologistics
Copy link

Could it be related to VS Code's 1.52.0 minor version bump? What do you think guys?

Possible but doubtful because I reverted to 1.51 to test and it still happened for me. That said, in theory 1.52 could have introduced new/changed user settings that contribute to this issue and reverting to 1.51 would therefore not undo that.

@ecmel
Copy link
Owner

ecmel commented Dec 17, 2020

Fixed in 1.2.0

@ecmel ecmel closed this as completed Dec 17, 2020
@tonix-tuft
Copy link

No more "css.watcherEnabled": false in 1.2.0? I wanted to try the update and re-enable the watcher again, but the option is missing in VS Code after I updated the extension.

@ecmel
Copy link
Owner

ecmel commented Dec 17, 2020

Yes because there is no directory watcher. You can specify local and remote css files in a new settings (per workspace folder) css.styleSheets.

@tonix-tuft
Copy link

OK, so I if I have just updated the extension to 1.2.0 and I don't see CPU spikes anymore I am good to go, right? :)

@johnnywo
Copy link

Looks good now, thanks a lot!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants