SchoofsKelvin / vscode-sshfs

Extension for Visual Studio Code: File system provider using SSH
GNU General Public License v3.0
543 stars 36 forks source link

Mac M1 - Electron process high CPU #329

Closed tamet83 closed 2 years ago

tamet83 commented 2 years ago

Hi,

I don't know why but when I use this plugin on my mac book air m1 I noticed that the electron process uses over the 100% of the CPU.

What kind of information can I give you to debug this behavior?

Thanks

SchoofsKelvin commented 2 years ago
tamet83 commented 2 years ago

Hello,

sorry for the delay.

  1. I'm using VS Cose V. 1.65.2 (Universal)
  2. I installed the plugin lately, a month ago if I remember well.
  3. The problem happens immediately after I start a SSH session and remain active even if I quit VSC and I need to kill the process manually.

Here a screenshot:

Schermata 2022-03-21 alle 21 09 50

The CPU usage increases more and more after time as you can see:

Schermata 2022-03-21 alle 21 12 47

Whereas here the process info:

cwd
/
txt
/Applications/Visual Studio Code.app/Contents/MacOS/Electron
txt
/Applications/Visual Studio Code.app/Contents/Frameworks/Squirrel.framework/Versions/A/Squirrel
txt
/Applications/Visual Studio Code.app/Contents/Frameworks/Mantle.framework/Versions/A/Mantle
txt
/Library/Preferences/Logging/.plist-cache.4lhffmxv
txt
/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/v8_context_snapshot.arm64.bin
txt
/Users/matteo/.vscode/extensions/keesschollaart.vscode-home-assistant-1.26.0/node_modules/bufferutil/prebuilds/darwin-x64+arm64/node.napi.node
txt
/Applications/Visual Studio Code.app/Contents/Frameworks/ReactiveObjC.framework/Versions/A/ReactiveObjC
txt
/Users/matteo/.vscode/extensions/keesschollaart.vscode-home-assistant-1.26.0/node_modules/utf-8-validate/prebuilds/darwin-x64+arm64/node.napi.node
txt
/usr/lib/dyld
txt
/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libffmpeg.dylib
txt
/usr/share/icu/icudt68l.dat
txt
/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/icudtl.dat
txt
/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework
0
->0x4a1a107e1ad1e27
1
->0x4a1a107e1ad1fb7
2
->0x4a1a107e1ad2147
3
->0x4a1a107e1ad22d7
4
/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/icudtl.dat
5
count=2, state=0x8
6
->0x1a55649e91ea665f
7
->0xb9842e3b614aff4f
8
->0xeefacd677c5ea242
9
->0xc4ee38849a90bb92
10
->0xb548269e42e765ca
11
->0x69cea77e0ea0749e
12
/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/v8_context_snapshot.arm64.bin
13
count=0, state=0
14
->0x729e5cd626dda921
15
->0x13559512ccb46e35
16
->0x203269762bf4fecb
17
->0x3d92afbca2d874e3
18
count=0, state=0x12
19
count=0, state=0xa
20
->0x80b537d6e104d5f0
21
->0x97eed112b854ee21
22
->0x2f12c90be685e4c7
23
->0xb91df9bb0ba043c8
24
/dev/null

Let me know if you need other info and thanks for your help.

SchoofsKelvin commented 2 years ago

I don't know if you have access to the output pane when VS Code is frozen (I assume the extension host process is frozen, not the UI), but if possible:

Some more questions to help me figure out the cause:

tamet83 commented 2 years ago

Hi,

I think the problem is with VSC, i'm not the only one as you can see here. I tried to open an issue on VSC official github page

SchoofsKelvin commented 2 years ago

It looks like they did some upgrades and reverts regarding Electron between 1.64 and 1.65.2 which I assume lead to the issue. Something similar happened in #239 where an Electron upgrade resulted in certain algorithms crashing the extension host when used. Since the high CPU usage in your case only happens when you start a SSH connections, it might be something very similar. You can actually try adding the DF-GE and see if that fixes it. Very low chance, but it might.

I'll be closing this ticket for now. If something changes and it looks like the extension's fault again, or there's a quick fix I can implement (e.g. disabling certain ciphers/algorithms), feel free to comment and reopen this ticket.

tamet83 commented 2 years ago

Hello, we find out what's causing this issue. The fault wasn't from your addon. Right now the problem isn't solved, I had to disable the addon. I leave the links for future reference.