microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.28k stars 29.31k forks source link

High CPU and eventual hang when opening a big repo #229713

Closed rmarinho closed 1 month ago

rmarinho commented 1 month ago

Type: Bug

When I m trying to open the .NET MAUI repo on VSCode the experience on my MacBookPro M3 gets really bad. The CPU goes to 100% and eventually hangs and restarts my machine.

Screenshot 2024-09-25 at 13 46 55

image

Closing VScode the CPU goes down image

A normal usage seems like this staring a run on iOS simulator so we see a spike

image

then goes back to normal while debugging

image

Repro steps

Clone dotnet/maui Execute

dotnet workload install maui
dotnet tool restore
dotnet cake --target=VS --workloads=global

VS Code version: Code 1.93.1 (38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40, 2024-09-11T17:20:05.685Z) OS version: Darwin arm64 23.6.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Apple M3 Pro (12 x 2400)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|3, 4, 15| |Memory (System)|36.00GB (0.12GB free)| |Process Argv|--crash-reporter-id 1745e319-f686-4b62-a64a-b56d8de3f9a8| |Screen Reader|no| |VM|0%|
Extensions (29) Extension|Author (truncated)|Version ---|---|--- VSCode-MAUI-Archive|ban|1.1.2 cake-vscode|cak|2.1.1 copilot|Git|1.234.0 copilot-chat|Git|0.20.3 vscode-github-actions|git|0.27.0 flux|inf|1.0.4 dbc|lha|2.0.0 vscode-azureresourcegroups|ms-|0.9.5 csdevkit|ms-|1.11.9 csharp|ms-|2.48.31 dotnet-maui|ms-|1.4.20 vscode-dotnet-runtime|ms-|2.1.6 vscodeintellicode-csharp|ms-|2.1.11 debugpy|ms-|2024.10.0 python|ms-|2024.14.1 vscode-pylance|ms-|2024.9.2 sarif-viewer|MS-|3.4.4 semantic-kernel|ms-|0.12.0 jupyter|ms-|2024.8.1 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.19 vscode-jupyter-cell-tags|ms-|0.1.9 vscode-jupyter-slideshow|ms-|0.1.6 remote-containers|ms-|0.384.0 remote-wsl|ms-|0.88.4 mono-debug|ms-|0.16.3 powershell|ms-|2024.2.2 intellicode-api-usage-examples|Vis|0.2.8 vscodeintellicode|Vis|1.3.1
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyonecf:30548226 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonnoceb:30805159 asynctok:30898717 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 0ee40948:31013168 a69g1124:31058053 dvdeprecation:31068756 dwnewjupyter:31046869 2f103344:31071589 impr_priority:31102340 nativerepl1:31139838 refactort:31108082 pythonrstrctxt:31112756 flighttreat:31134774 wkspc-onlycs-t:31132770 wkspc-ranged-t:31125599 fje88620:31121564 iacca1:31138162 cc771715:31140165 ```
dellis1972 commented 1 month ago

I have seen something similar when building maui. It seemed to happen when it was installing the custom version of dotnet. I could be wrong about that though.

roblourens commented 1 month ago

wdavdaemon and dlpdaemon are related to Windows Defender. You might have this installed if your company manages your mac. They do slow things down when many files are being read. There's probably nothing that can be done here, but if you want to investigate further, you could take it up with the dotnet cli or extension.

rmarinho commented 1 month ago

Hum yeah my company is Microsoft it makes me install Defender on the Mac :)

dellis1972 commented 1 month ago

Hum yeah my company is Microsoft it makes me install Defender on the Mac :)

snap 🤣

roblourens commented 1 month ago

Then I feel your pain 😅