Closed vmatyus closed 2 years ago
Could you please share the contents of the Git output channel
which you can access by invoking the Git: Show Git Output
command in the command palette? Thanks!
Having the exact same issue since I updated VSCode last week!
Thanks to this problem I switched VS Code with another IDE tool (IntelliJ) and today I opened the VS code with the project and I cannot see the Electron peak anymore. I hope this will be permanent.
I've check the Git: Show Git Output
as per you requested:
Having same issue after I updated VSCode.
In Activity app I can see that Code - Electron - java
causing high cpu.
Same issue on M1 macbook air, with vscode, the moment it loads up electron usage goes to 100%.
Initially i thought it could be because of electron and some bug with it, but I also heavily use discord, But only in the case of vscode the electron usage was 100%
Can't do anything, TS intellisense also takes too long due to this
@lszomoru I can think the issue is with Version: 1.64.2, I uninstalled it and installed the code-insiders edition to test. It worked fine for some time, until i opened a typescript file. the usage again went to 90%
@sidwebworks, that for the additional information. Does CPU usage increases as soon as you open the typescript file? Does the CPU usage maintains?
@mattbierner, would an extension host profile help track down the CPU consumption when opening a typescript file?
Hi @lszomoru I managed to solve this issue, you can read more about it here. https://github.com/MicrosoftDocs/live-share/issues/4539#issuecomment-1051056537
Thanks @sidwebworks for the update. @mattbierner, could you please take a look as the issue could be related to TypeScript. Thanks!
@sidwebworks So you don't see this issue when using VS Code insiders with TS 4.4.x? What about when using TS 4.6?
If you still see this issue, can you share a project and specific steps to reproduce the issue so we can investigate?
@mjbvz Yeah sure would love to help as much as I can, honestly there were 2 main issues I was facing due to the 100% CPU.
Intellisense was too slow and soon whole vscode freezed.
Trying to build any project with used TS was just hanging up and hogging on CPU.
Switching to vscode-insiders also didn't fix it for me. Not even a clean mac os installation fixed it.
At last the moment I switched to the nightly TS/JS extension and reloaded vscode, all the issues related to the editor freezing and Intellisense were gone.
But the builds still didn't work. Soon I saw an issue on TSC where there was some infinite recursion going on in the compiler. Which caused that issue. So downgrading the typescript version to 4.4.4 fixed it.
So far it's been fine but if anything breaks I'll report here with a repro.
I will try to repro the bug is possible, by switching back to the old extension. Will see if it breaks again.
Closing as it seems like @vmatyusGitHub can no longer reproduce this issue
High cpu usage is a very generic symptom with many possible causes so if you are still seeing perf problems, please open a new issue so we can investigate separately
After the APR 2022 update, high electron usage, my Intel Mac (which is a beast, see screenshot below) is constantly spinning the fans!! http://b3.ms/aKb9Lzj7Jn3R
After apr update I'm seeing also high cpu on electron. Going back to march solves this...
Can you please share some steps what can I do, when I experiencing the high cpu load? (to help you in the investigation)
Just starting vscode is enough to get the electron process to 100%
I mean @mjbvz would you please help us in providing some steps how can we help you in the investigation, can I provide some info about the Electron or where can I check Electron logs?
@vmatyusGitHub As stated above, just start VS CODE. For me it was like this: Vs Code has updates, cool, restart computer, restart apps. Restarted Mac, hoped for the app to be restarted and updated, did not happen, restarted the app to apply the update. Fans started working the soon i restarted vscode, verified if indexing is happening in the background, restarted multiple times vsCode, cpu usage is always 100%+, ~120% minimised, ~150% maximised/focused. There is no much i can tell you to reproduce, for me is standard usage.
Day by day:
Have you tried following the steps on https://github.com/microsoft/TypeScript/wiki/Performance-Tracing? This page helped me isolate my TS CPU/Electron process issues. If you want, you can upload the trace.json
file so we (at least me) can take a look.
My issue was due to an updated library and its complex type definitions that were killing the "type checking phase" of the trace.
@jmca yes, not going to happen (i do not have the time for this), downgraded to 1.66 for now, it works fine, until it gets figured it out, will stay on this release.
same here since updating to 1.67 using a M1 Pro MacBook Pro
Now, I've updated to Version: 1.67.0 , Electron: 17.4.1 I hope there will be no more problem with Electron there.
Have you tried following the steps on https://github.com/microsoft/TypeScript/wiki/Performance-Tracing?
No, but I will when I meet this problem again. Thanks!
I run this issue again.
It took a few seconds to create tsconfig.json
file with this load:
The Git: Show Git Output
command shows this constantly:
I tried to run this tsc
solution, but my project is not fuly a js/ts project, however has some a folder with js files, so I created tsconfig.json
there in a folder.
I created this snapshot, but could not catch the Electron with it.
Here is a snapshot from the Activity Monitor:
There was an old node_module
directory in one of the folders, I deleted it, since it is not needed anymore. I hope this solved the issue... I need to change node version here-and-there, so the "type checking phase" in node could be also a problem in my case too.
@vmatyusGitHub If you are still seeing issues, follow these instructions to see which subprocess has high cpu usage https://github.com/microsoft/vscode/wiki/Performance-Issues#visual-studio-code-is-consuming-a-lot-of-cpu
@mjbvz the link provided only details how to do this on Windows. Are there other docs describing it on macOS? I've searched for the Help>Open Process Explorer
prompt per the guide and it doesn't appear on macOS.
@Justintime50
Or run it from the command palette
@mjbvz thank you! For whatever reason, this isn't indexed in the search box under help but is appearing at either location.
I tested with a simple NodeJS project. Opening vscode everything is ok. Opening simple JS file with a normal function and an export, everything is ok. Then opening a JS file which is loading a npm module (require('axios') ) and one of the Electron processes goes to 100% and fans start to spin up. Checking the process explorer it is tsserver.js. Reverting back to january release 1.64.2 and problem goes away. That is the last version working.
OS: MacOS 12.3.1
@pvelin Please open a new issue. Be sure to include a sample project so we can try to reproduce the problem
I have around 26% cpu usage with an open python
file. And the fans on my 16" M1 Pro MBP turn up despite them being usually shut off.
VSCode: 1.67.1 OS: MacOS 12.3.1
@mjbvz Thank you for pointing it out, this way i found out that VUE/VOLAR plugin/extension was causing the overhead (200%+ CPU time o_O ). My Vscode is finally "silent" again. (ps: still need to work full day to know that it's fully silenced)
Mine is silent too. I had a Javascript config object that I was exporting with module.exports = config and after that individually exporting exports.foo = config.foo, exports.bar = config.bar. This will put one of the Electron processes to 100%. Removing those individual exports and everything is ok. In my previous post I thought it was something to do with importing npm module but was not. It was old code. I cleaned up and now everything is fine.
If you are not @vmatyusGitHub, please stop posting in this thread and open new issues if you are still seeing problems
Turned out this Electron process also could block the results from global search. Next time I hope I can make some digging.
I met with this problem again and now I could filter down to 1 extension: Gauge I made the profile recording for 30s long.
0 360 31235 window ( my-file — my-folder-have-multiple-gauge-projects)
-->99<-- 197 31305 extensionHost
0 49 31563 /Library/Java/JavaVirtualMachines/ibm-semeru-open-8.jdk/Contents/Home/bin/java -jar ${USERFOLDER}/.vscode/extensions/vscjava.vscode-gradle-3.12.0/lib/gradle-language-server.jar
0 49 31571 /Library/Java/JavaVirtualMachines/ibm-semeru-open-8.jdk/Contents/Home/bin/java -Dfile.encoding=UTF-8 -classpath ${USERFOLDER}/.vscode/extensions/vscjava.vscode-gradle-3.12.0/lib/gradle-server.jar com.github.badsyntax.gradle.GradleServer 58907
0 16 31594 /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node ${USERFOLDER}/.vscode/extensions/streetsidesoftware.code-spell-checker-2.2.0/packages/_server/dist/main.js --node-ipc --clientProcessId=31305
0 33 31915 /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node ${USERFOLDER}/.vscode/extensions/ms-python.vscode-pylance-2022.5.2/dist/server.bundle.js --cancellationReceive=file:9843c48d76668a04f4b96cab6ac5469a4d05a5fbd0 --node-ipc --clientProcessId=31305
I have a fodler with multiple gauge project, this might cause trouble for the VSCode. I set the Gauge extension to disabled, but still causes the same CPU result.
Updated to the latest version and have now gone back to November 2021 (version 1.63). please solve this issue as the updates in the new version were quite nice...
Updated to the latest version and have now gone back to November 2021 (version 1.63). please solve this issue as the updates in the new version were quite nice...
downgrade from 1.67 to 1.63 finally solved my problem 😭😭😭
Same question on upgrading 1.67.
After checking Process Explorer, I find it was the extension host consume high CPU.
Refer the issue, run Help: Start Extension Bisect
command, I find if I disable Settings Sync
extension, the CPU will be normal in my case. Weird!!!🤯
Thanks guys, for me, it was the extension CSS Peek
, after uninstalled it, all good now.
For me it is the Pylance extension (v.2022.5.3).
Settings Sync was the culprit for me. But with the variety of extensions mentioned here, it seems safe to assume the extensions themselves may cause the symptoms, but are not the root cause of the problem.
I also disabled Settings Sync and the problem was resolved. Before that every open VSCode window had an Electron process constantly using 40-70% CPU.
Issue Type: Bug
Steps to Reproduce:
The CPU usage of
Electron
process goes up to 99% and stays there. It also not detects the git repository and requests forInitialize Repository
VS Code version: Code 1.64.2 (f80445acd5a3dadef24aa209168452a3d97cc326, 2022-02-09T22:00:58.347Z) OS version: Darwin x64 20.6.0 Restricted Mode: No
System Info
|Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2300)| |GPU Status|2d_canvas: enabledgpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled| |Load (avg)|3, 3, 4| |Memory (System)|16.00GB (0.25GB free)| |Process Argv|--crash-reporter-id 5a55a32c-43c3-44c3-afdc-72a219143f27| |Screen Reader|no| |VM|0%|
Extensions (40)
Extension|Author (truncated)|Version ---|---|--- markdown-preview-github-styles|bie|1.0.1 gitignore|cod|0.7.0 vscode-markdownlint|Dav|0.46.0 vscode-eslint|dba|2.2.2 dendron|den|0.81.0 dendron-markdown-preview-enhanced|den|0.10.57 dendron-markdown-shortcuts|den|0.12.1 dendron-paste-image|den|1.1.0 dendron-snippet-maker|den|0.1.6 gitlens|eam|11.7.0 gauge|get|0.1.0 go|gol|0.31.1 rest-client|hum|0.24.6 jenkins-pipeline-linter-connector|jan|1.2.0 intellij-idea-keybindings|k--|1.5.0 code-groovy|mar|0.1.2 dotenv|mik|1.0.1 vscode-docker|ms-|1.19.0 python|ms-|2022.0.1814523869 vscode-pylance|ms-|2022.2.1 jupyter|ms-|2022.1.1001821375 jupyter-keymap|ms-|1.0.0 jupyter-renderers|ms-|1.0.6 remote-containers|ms-|0.217.2 vscode-ginkgo|ons|0.0.1 java|red|1.3.0 vscode-commons|red|0.0.6 vscode-yaml|red|1.4.0 ginkgo-lens|sel|1.0.0 rewrap|stk|1.16.1 code-spell-checker|str|2.1.6 vscodeintellicode|Vis|1.2.17 vscode-conventional-commits|viv|1.24.0 vscode-gradle|vsc|3.10.0 vscode-java-debug|vsc|0.38.0 vscode-java-dependency|vsc|0.19.0 vscode-java-pack|vsc|0.21.0 vscode-java-test|vsc|0.34.0 vscode-maven|vsc|0.35.0 vscode-open-in-github|ziy|1.3.6