Closed BuckAMayzing closed 3 years ago
Here's the CPU profile:
Indeed, the CPU profile doesn't show anything relevant. So the CPU usage doesn't come from the JS/UI thread.
What is very fishy is that I see from your process info high cpu usage in the main process, in the window renderer process, but also in the shared process (which is also a renderer process, but which is never visible and shouldn't really do anything most of the time). There is also high CPU usage in the issue reporter renderer process itself. This makes me believe it might be an Electron issue.
@deepak1556 Are there more detailed steps that @BuckAMayzing could take to troubleshoot the high CPU usage?
There is also high CPU usage in the issue reporter renderer process itself. This makes me believe it might be an Electron issue.
This thought has crossed my mind as well. I have seen Slack spike as high as 40 or 50% in recent months, which always felt odd to me given how little processing Slack needs to do. I'm also not sure how to go about diagnosing, but I'm happy to follow any steps that @deepak1556 suggests.
I am also running into this quite frequently on my Macbook pro 16" and have to restart vscode to avoid having the fan running all the time & sluggish performance. I am running typescript, eslint & the red hat java extension.
Sorry for the delayed response, @BuckAMayzing can you record and send the following trace to Deepak.Mohan@microsoft.com
xcrun xctrace record --template 'System Trace' --output <some-path>/code_system.trace --attach <pid>
Still happening for our team with no extensions and single file open.
Version: 1.51.1 Commit: e5a624b788d92b8d34d1392e4c4d9789406efe8f Date: 2020-11-11T01:11:34.018Z (1 wk ago) Electron: 9.3.3 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Darwin x64 19.6.0
Is this still an issue with latest insiders https://code.visualstudio.com/insiders ?
Found this issue yesterday after running into the same issue. I installed Insiders last night and worked for several hours without any issues. Just now it became unresponsive and it doesn't even close when Force Quit. For the last ~5+ minutes, three renderer processes have been using 500%+, 300%+, and almost 200%.
I'm on a 15" 2019 Macbook Pro with macOS Big Sur 11.2.1
~Once I can open VS Code Insiders again I'll edit w/the version and the few extensions I have installed.~
Version: 1.54.0-insider (Universal) Commit: a699ffaee62010c4634d301da2bbdb7646b8d1da Date: 2021-02-15T05:15:52.209Z (1 day ago) Electron: 11.2.3 Chrome: 87.0.4280.141 Node.js: 12.18.3 V8: 8.7.220.31-electron.0 OS: Darwin x64 20.3.0
Extensions:
@wfendler yup when it happens again, also provide the output of code-insiders --status
@deepak1556 - I'm a bit behind answering your question. It's tough for me to say that it's still occurring/not occurring. I was having some serious performance issues related to symlinks that we have in our repo (used by Bazel). Adding those to files.watcherExclude
has significantly reduced CPU usage. I can't say for sure that it has been eliminated, because I do see the occasional spike. It's been tough to catch at a time that I can run the trace, though.
With both the latest public VSC and this morning's insider build we are seeing sustained ~140% CPU usage by the renderer with no editing or debugging activity going on in the editor (e.g. just open). Prior to last fall this type of use wasn't causing constant CPU use.
Extensions: GitLens 11.2.1 Numbered Bookmarks 8.0.1 PHP Debug 1.14.9 PHP DocBlocker 2.1.0 pcpcs 1.0.5
Sent a status if it is helpful.
An update...I noted that the symlinks follow was on by default in the code-insiders so after disabling that (to match the latest safe build settings I was using) I haven't noticed excessive CPU use. Still monitoring but hopeful.
Sadly ran into the issue today but captured:
$ code-insiders --status Conflict in settings file file:///Users/REDACTED/Library/Application%20Support/Code%20-%20Insiders/User/settings.json: Ignoring editor.defaultFormatter.possible as editor.defaultFormatter is "bmewburn.vscode-intelephense-client" Version: Code - Insiders 1.54.0-insider (192c817fd350bcbf3caecae22a45ec39bae78516, 2021-02-19T05:13:45.061Z) OS Version: Darwin x64 20.3.0 CPUs: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz (16 x 2400) Memory (System): 32.00GB (0.28GB free) Load (avg): 3, 3, 3 VM: 0% Screen Reader: no Process Argv: --crash-reporter-id 999a9c7d-ebba-4e31-b778-e2fbb6d70bec GPU Status: 2d_canvas: 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 98 3339 code-insiders main 0 66 3354 gpu-process 0 33 3366 utility 0 295 3372 window (Database.DeviceUsers.inc.php — Website) 0 98 3410 extensionHost 0 66 3455 electron_node server.js 145 2654 7733 watcherService 0 66 3417 shared-process 0 33 3419 ptyHost 0 0 3423 /bin/bash -l 0 0 11021 bash /usr/local/bin/code-insiders --status 0 33 11031 electron_node cli.js
Workspace Stats: | Window (Database.DeviceUsers.inc.php — Website) | Folder (Website): 8599 files | File types: php(3509) png(528) po(433) test(280) js(191) md(142) | jpg(108) json(104) rst(96) css(84) | Conf files: launch.json(1) makefile(1) | Launch Configs: php(2)
@bhmasterson in your case the cpu usage is by the watcher service, can you open a separate issue with the above data. @bpasero the watcher service doesn't support --inspect
flags similar to extension host which makes it hard to profile JS in this service, moving the above issue to you for further triaging.
I am closing this issue for now based on https://github.com/microsoft/vscode/issues/110323#issuecomment-724890073 , feel free to open a new issue with the relevant trace data if the issue is seen again. Thanks!
Issue Type: Performance Issue
I'm on version 1.51, and I believe the rest of the team is as well.
We're having trouble with specific steps to reproduce. We're all on Mac OS (10.15.7, I believe) and working out of a relatively small mono repo (about 331MB after a fresh clone). This seems to occur most often after pulling from master and/or changing branches, but it can happen intermittently most of the time. The renderer will spike anywhere from 250-500% CPU (8 core machines), and can freeze the UI.
Disabling extensions seems to have no effect. Some of us are working out of a workspace file that doesn't open the entire mono repo, and that doesn't seem to have an effect. I'm including a CPU profile, but it doesn't appear to explain the high CPU usage we're seeing in the Activity monitor.
I found #108441, which seemed promising, since we use quite a few symlinks in this repo, but it appeared to be patched in 1.50, so I'm not sure where to go from here to diagnose this.
VS Code version: Code 1.51.0 (fcac248b077b55bae4ba5bab613fd6e9156c2f0c, 2020-11-05T18:14:40.758Z) OS version: Darwin x64 19.6.0
System Info
|Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 x 2600)| |GPU Status|2d_canvas: enabledflash_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| |Load (avg)|3, 8, 7| |Memory (System)|16.00GB (0.06GB free)| |Process Argv|--verbose --crash-reporter-id 44eb1936-fdfd-4ec1-b968-d1e82ed21574| |Screen Reader|no| |VM|0%|
Process Info
``` CPU % Mem MB PID Process 20 98 933 code main 6 66 936 gpu-process 0 16 943 utility 22 328 944 window (ContactForm.tsx — underwriter) 0 0 945 /usr/local/bin/fish -l 0 246 961 extensionHost 0 115 990 electron_node tsserver.js 0 279 991 electron_node tsserver.js 0 66 1018 electron_node typingsInstaller.js typesMap.js 0 33 994 electron_node server.js 0 131 1186 electron_node eslintServer.js 0 33 1250 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer) /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=961 0 311 985 watcherService 0 33 987 searchService 23 115 986 shared-process 0 0 1305 /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command= 1 410 1296 window (undefined) 42 49 1303 window (Issue Reporter) ```Workspace Info
``` | Window (ContactForm.tsx — underwriter) | Folder (underwriter): 17020 files | File types: map(3262) ts(3213) js(1699) py(1513) pyc(768) json(575) | tsx(547) yaml(446) txt(114) thrift(79) | Conf files: package.json(35) tsconfig.json(29) launch.json(2) | tasks.json(2) webpack.config.js(2) github-actions(1) | settings.json(1) csproj(1) | Launch Configs: node(4) chrome pwa-chrome; ```Extensions (38)
Extension|Author (truncated)|Version ---|---|--- better-toml|bun|0.3.2 thrift|cdu|0.0.1 vscode-postgres|cko|1.1.14 vscode-eslint|dba|2.1.13 daddy-jest|dev|1.0.0 gitlens|eam|10.2.3 vscode-great-icons|emm|2.1.60 vsc-material-theme|Equ|33.0.0 vsc-material-theme-icons|equ|1.2.0 prettier-vscode|esb|5.7.1 vscode-firefox-debug|fir|2.9.1 vscode-pull-request-github|Git|0.21.0 vscode-graphql|Gra|0.3.11 todo-tree|Gru|0.0.187 vscode-test-explorer|hbe|2.19.3 vscode-power-mode|hoo|2.2.0 vscode-styled-components|jpo|1.2.0 fish-ide|lun|0.4.0 thrift-syntax-support|mrk|0.0.4 vscode-docker|ms-|1.7.0 csharp|ms-|1.23.5 python|ms-|2020.10.332292344 remote-containers|ms-|0.148.0 cpptools|ms-|1.1.1 powershell|ms-|2020.6.0 vscode-typescript-next|ms-|4.2.20201109 vsliveshare|ms-|1.0.3121 debugger-for-chrome|msj|4.12.11 material-icon-theme|PKi|4.4.0 vscode-xml|red|0.13.0 vscode-direnv|Rub|0.0.2 rust|rus|0.7.8 crates|ser|0.5.3 code-settings-sync|Sha|3.4.3 fish-vscode|sky|0.2.1 vscode-icons|vsc|11.0.0 debug|web|0.25.0 material-theme|zhu|3.9.3 (3 theme extensions excluded)