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

High CPU Usage When Accessing .NET Webforms Project on Windows SMB Share #79456

Closed
r3volution11 opened this issue Aug 19, 2019 · 17 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug perf workbench-diagnostics General VS Code built-in diagnostic issues
Milestone

Comments

@r3volution11
Copy link

Issue Type: Bug

On a MacBook Pro '16:

  1. Connect to Windows Shared Drive through SMB
  2. Add .NET Webforms Project to VS Code Window
  3. Watch Computer Possibly Explode - High CPU usage causes terrible slow downs, sometimes WindowsServer restarts.

Note: I disabled extensions before reporting this issue. It still occurs.

It's something I've had issues with since VS Code was first released. It's also not consistent. Sometimes things are fine for a brief period of time, then something happens and it starts eating CPU. Other times, like during my submitting this issue, it'll happen right away and then disappear after a period of time. But quite often, when it does happen, it ends up requiring me force quitting VS Code processes and trying again.

Unfortunately, I can't supply any of the projects where this occurs due to copyright. But the sites are built on AspDotNetStorefront and hosted on a Windows 10 VM locally. It's not the smallest project but it's not really that large either. I have even ignored many directories hoping that will help - it doesn't appear to.

Thanks for listening.

VS Code version: Code 1.37.0 (036a6b1, 2019-08-08T01:22:37.660Z)
OS version: Darwin x64 19.0.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz (8 x 2900)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 6, 5, 5
Memory (System) 16.00GB (0.35GB free)
Process Argv -psn_0_13974867
Screen Reader no
VM 14%
Extensions (59)
Extension Author (truncated) Version
better-comments aar 2.0.5
scss-lint ada 0.1.8
Bookmarks ale 10.5.0
project-manager ale 10.6.0
Handlebars and 0.4.1
vscode-color ans 0.4.5
razor-plus aus 0.1.4
vscode-intelephense-client bme 1.1.6
twigcs cer 1.1.0
npm-intellisense chr 1.3.0
vscode-svgviewer css 2.0.0
vscode-markdownlint Dav 0.30.1
mustache daw 1.1.1
jshint dba 0.10.21
vscode-eslint dba 1.9.0
EditorConfig Edi 0.13.0
vscode-npm-script eg2 0.3.8
moxer-icons Equ 3.0.0
vsc-material-theme Equ 30.0.0
vsc-material-theme-icons equ 1.0.6
php-intellisense fel 2.3.10
cshtml-tm fir 1.0.0
text-transform flo 0.1.0
auto-close-tag for 0.5.6
html-leaf Fra 0.1.3
unibeautify-vscode Gla 0.7.0
npm-dependency-links her 1.0.1
beautify Hoo 1.5.0
output-colorizer IBM 0.1.2
path-autocomplete ion 1.13.3
svg joc 0.1.6
classic-asp-html jtj 0.1.1
swift Kas 0.1.0
vscode-swift kia 0.8.0
tag-rename kri 0.2.1
twig-language mbl 0.8.9
twig-language-2 mbl 0.8.9
dotenv mik 1.0.1
HTMLHint mka 0.6.0
vscode-scss mrm 0.6.2
python ms- 2019.8.30787
color-highlight nau 2.3.0
vetur oct 0.22.2
material-icon-theme PKi 3.8.1
material-design-icon-svg-snippets r3v 3.8.95
vscode-swift-language rlo 0.2.0
gi rub 0.2.11
aspnet-helper sch 0.6.4
code-settings-sync Sha 3.4.1
stylelint shi 0.51.0
swiftlint shi 0.1.3
vscode-fileutils sle 2.14.5
highlight-matching-tag vin 0.9.3
vscode-swift-development-environment vkn 2.8.0
vscode-todo-highlight way 1.0.4
twig wha 1.0.2
wordpress-toolbox wor 1.3.4
better-align wwm 1.1.6
vscode-surround yat 1.0.2

(1 theme extensions excluded)

@RMacfarlane
Copy link
Contributor

Hey @r3volution11, thanks for reporting this and for all of the info. When you experience the issue again, can you try running the Developer: Open Process Explorer command to try to see which process within VSCode is consuming CPU? More info on that here: https://github.com/microsoft/vscode/wiki/Performance-Issues#visual-studio-code-is-consuming-a-lot-of-cpu

We also have builds targeting a much newer version of our UI framework (Electron version 6.0.x). Can you give that version a try? Download:

@RMacfarlane RMacfarlane added perf info-needed Issue requires more information from poster labels Aug 19, 2019
@r3volution11
Copy link
Author

r3volution11 commented Aug 21, 2019

Activity Monitor Screenshot: http://r3v.in/LlijA/Screen-Shot-2019-08-21-11-31-23.74.png

Process Explorer Screenshot: http://r3v.in/k3YTT/Screen-Shot-2019-08-21-11-32-24.29.png

I've seen the process explorer look different before with several instances. I don't recall it ever being so bare as it is there.

I'll try using one of the newer builds. Thanks for your help!

Update: Here's a new shot of the Process Explorer as it typically looks: http://r3v.in/i7yNR/Screen-Shot-2019-08-21-11-45-41.72.png

@r3volution11
Copy link
Author

r3volution11 commented Aug 21, 2019

VS Code Exploration Screenshots:

Activity Monitor: http://r3v.in/OQsR3/Screen-Shot-2019-08-21-11-40-18.88.png

Process Explorer: http://r3v.in/xAvgK/Screen-Shot-2019-08-21-11-39-10.53.png

If anything the problem "feels" worse here.

FYI, I also disable git.

@r3volution11
Copy link
Author

Approximately 30 minutes after opening, on the regular build, the CPU usage is back to normal.

@RMacfarlane
Copy link
Contributor

Ah, ok! The last process explorer screenshot and your observation that it stops some time after opening make me think this is related to a telemetry event we log on startup. We log data about what file types are in the current workspace so we get a sense of what languages are being used in VSCode. This is from within the "shared process" and involves walking the file tree, I think this would be expensive over SMB.

Can you try disabling telemetry by unchecking the "Telemetry: Enable Telemetry" setting and see if it still repros to confirm if this is the case?

@r3volution11
Copy link
Author

Yes, it still happens.

Process Explorer: http://r3v.in/nYszL/Screen-Shot-2019-08-21-13-05-14.79.png
Activity Monitor: http://r3v.in/ziapn/Screen-Shot-2019-08-21-13-05-51.52.png

You got my hopes up. 😆

@r3volution11
Copy link
Author

r3volution11 commented Aug 21, 2019

I guess another question is: should I use something other than SMB?

@RMacfarlane
Copy link
Contributor

RMacfarlane commented Aug 21, 2019

Haha, sorry! I actually still think it's this code that's a problem, the shared process is still high in the screenshot you sent and there's not much heavy lifting it does besides that.

Looking at the code that logs this event - if telemetry is disabled, it still does the whole computation and sends it to the telemetry service. The service checks if telemetry is disabled at that point and will ignore it if so. I can add an earlier check to prevent the work being done in that case, and look into improving the perf of the event computation.

If you're able to SSH into your VM instead, that would be more performant. Some info on that: https://code.visualstudio.com/docs/remote/ssh

Edit: Actually, ignore that, that wouldn't work for you currently since it's a windows VM 😢

@RMacfarlane RMacfarlane added workbench-diagnostics General VS Code built-in diagnostic issues and removed info-needed Issue requires more information from poster labels Aug 21, 2019
@RMacfarlane RMacfarlane self-assigned this Aug 21, 2019
@r3volution11
Copy link
Author

Yea, I'd love to take advantage of the remote ssh extension. I'm actually one of the first to write up an issue about it (microsoft/vscode-remote-release#25).

What I don't understand is that this problem doesn't occur with all of my projects on this VM. There's one in particular and I can not for the life of me figure out why. 7 projects, all very close to the same but different frontends.

@RMacfarlane
Copy link
Contributor

Can you try running code --status from the terminal when that project is open, and when a project without the problem is open, and report the output? It should include a "Workspace Stats" section about number and types of files

@r3volution11
Copy link
Author

r3volution11 commented Aug 21, 2019

I think Code is upset with me. I opened a local, small project and the shared process ate up the CPU as well this time. I quit Code but the processes were left hanging and needed to be force quit. Reopened the project in Code and ran code --status and it gave me this:

Working Fine Log Version: Code 1.37.1 (f06011a, 2019-08-15T16:16:34.800Z) OS Version: Darwin x64 19.0.0 CPUs: Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz (8 x 2900) Memory (System): 16.00GB (0.14GB free) Load (avg): 3, 4, 3 VM: 10% Screen Reader: no Process Argv: GPU Status: 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on native_gpu_memory_buffers: enabled oop_rasterization: disabled_off protected_video_decode: unavailable_off rasterization: enabled skia_deferred_display_list: disabled_off skia_renderer: disabled_off surface_synchronization: enabled_on video_decode: enabled viz_display_compositor: disabled_off webgl: enabled webgl2: enabled

CPU % Mem MB PID Process
1 82 61185 code main
0 33 61186 gpu-process
0 180 61194 window (build.js — vscode-materialdesignicons-svg)
0 98 61249 extensionHost
0 66 61278 electron_node tsserver.js
0 98 61279 electron_node tsserver.js
0 49 61311 electron_node typingsInstaller.js typesMap.js
0 33 61283 electron_node dbaeumer.js server.js
0 49 61285 electron_node server.js
0 33 61287 electron_node eslintServer.js
0 33 61288 electron_node server.js
0 33 61250 watcherService
0 33 61281 searchService
0 82 61257 shared-process
0 0 62245 /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=

Workspace Stats:
| Window (build.js — vscode-materialdesignicons-svg)
| Folder (vscode-materialdesignicons-svg): 16 files
| File types: json(4) md(2) js(1) vscodeignore(1) DS_Store(1)
| gitignore(1) vsix(1) jshintrc(1) png(1) sketch(1)
| Conf files: package.json(1) launch.json(1)
| Launch Configs: extensionHost

Attempting to run the command with a project that has problems does not return any information. It just sits there.

@r3volution11
Copy link
Author

Okay, I let it just sit there doing it's thing. Here it is:

Not Working Correctly Log Version: Code 1.37.1 (f06011a, 2019-08-15T16:16:34.800Z) OS Version: Darwin x64 19.0.0 CPUs: Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz (8 x 2900) Memory (System): 16.00GB (0.41GB free) Load (avg): 4, 3, 3 VM: 10% Screen Reader: no Process Argv: GPU Status: 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on native_gpu_memory_buffers: enabled oop_rasterization: disabled_off protected_video_decode: unavailable_off rasterization: enabled skia_deferred_display_list: disabled_off skia_renderer: disabled_off surface_synchronization: enabled_on video_decode: enabled viz_display_compositor: disabled_off webgl: enabled webgl2: enabled

CPU % Mem MB PID Process
1 82 61185 code main
0 33 61186 gpu-process
20 246 61257 shared-process
6 0 65448 /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
0 131 64739 window (● Web/Skins/aviator-gear/scss/_type.scss — Website)
0 66 64824 extensionHost
61 33 64841 electron_node server.js
0 16 64842 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/css-language-features/server/dist/cssServerMain --node-ipc --clientProcessId=64824
0 33 64843 electron_node server.js
0 16 64844 electron_node server.js
12 279 64831 watcherService
0 16 64845 searchService

Workspace Stats:
| Window (● Web/Skins/aviator-gear/scss/_type.scss — Website)
| Folder (Website): more than 141026 files
| File types: jpg(122604) png(13077) cs(1427) dll(1398) gif(465) pdb(392)
| cache(179) aspx(162) json(146) cshtml(127)
| Conf files: csproj(47) sln(1) settings.json(1) gulp.js(1)
| package.json(1)

I see it's reporting tons of images and dll's when I've ignored a majority of directories that contain those file types.

@RMacfarlane
Copy link
Contributor

@r3volution11 I made a change yesterday that should improve perf somewhat, can you give it a try? https://code.visualstudio.com/insiders/

@r3volution11
Copy link
Author

The problem remains on open, however, it does appear to dissipate more quickly.

@r3volution11
Copy link
Author

@RMacfarlane Will whatever you did in Exploration eventually make it into the main release? I'd at least be happy to see that. I just opened up a project in the latest main release and the problem hit big time.

@RMacfarlane
Copy link
Contributor

@r3volution11 Yes, the changes I made in the Insiders version should be available in the stable release that just shipped, version 1.39

@RMacfarlane RMacfarlane added this to the Backlog milestone Oct 25, 2019
@RMacfarlane RMacfarlane added the bug Issue identified by VS Code Team member as probable bug label Nov 3, 2020
@RMacfarlane
Copy link
Contributor

I'm going to go ahead and close this since it's now been 2 years and we haven't had further reports of this. Sorry for the incredible delay. Please open a new issue if you're still seeing problems. Thanks!

@github-actions github-actions bot locked and limited conversation to collaborators Jun 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug perf workbench-diagnostics General VS Code built-in diagnostic issues
Projects
None yet
Development

No branches or pull requests

2 participants