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

Code Helper high CPU usage on MacBook Pro 15 #11963

Closed
pitAlex opened this issue Sep 13, 2016 · 79 comments
Closed

Code Helper high CPU usage on MacBook Pro 15 #11963

pitAlex opened this issue Sep 13, 2016 · 79 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues info-needed Issue requires more information from poster

Comments

@pitAlex
Copy link

pitAlex commented Sep 13, 2016

  • VSCode Version: 1.5.2
  • OS Version: OSX El Capitan 10.11.6

I've notice there are several closed posts related to this issue, but it started to act up again. Before 1.5.2 I was using 1.3 since 1.4 had a problem with syntax highlighting and from time to time I used to get high cpu from "electron helper" even tough I have git disabled and only 3 extensions : "Project Manager", "Run on Save" and "HTML CSS Support". I upgrade to 1.5 and now Code Helper is the one that does it. I can happen 2, 3 times per day. It doesn't matter if you have lots of files opened or not, or if you are doing some had work, it just happens randomly. Once I left it minimize more then half an hour and my fans just started up suddenly as a result of the Code Helper going up to 99.9 CPU usage.

I've attached a screenshot showing the usage :
screen shot 2016-09-13 at 5 11 18 pm

@pitAlex pitAlex changed the title Code Helper hight CPU on MacBook Code Helper high CPU usage on MacBook Sep 13, 2016
@pitAlex pitAlex changed the title Code Helper high CPU usage on MacBook Code Helper high CPU usage on MacBook Pro 15 Sep 13, 2016
@bpasero
Copy link
Member

bpasero commented Sep 14, 2016

@pitAlex can you please find out the full arguments of this process to find out which process is causing high CPU load from the ones VS Code spawns as helpers.

@bpasero bpasero added info-needed Issue requires more information from poster freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues labels Sep 14, 2016
@bpasero bpasero added this to the Backlog milestone Sep 14, 2016
@bpasero bpasero self-assigned this Sep 14, 2016
@cjdell
Copy link

cjdell commented Sep 14, 2016

I'm having a similar issue with the Code Helper process. I have disabled all extensions. It appears to be steadily getting worse. It was minor annoyance a few weeks ago, I would occasionally just kill the Code Helper process and be back to normal again. Now the Code Helper just eats 100% of a core almost all of the time now. I even see this happen on occasion now:

image

@bpasero
Copy link
Member

bpasero commented Sep 14, 2016

@cjdell also please find out the full arguments of the process that goes ballistic: ps aux | grep <pid of process>

@cjdell
Copy link

cjdell commented Sep 14, 2016

@bpasero Here you go:

/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap --type=searchService

@bpasero
Copy link
Member

bpasero commented Sep 14, 2016

@pitAlex for you as well?

@chrmarti this points to an issue with search service, moving to you.

@bpasero bpasero removed this from the Backlog milestone Sep 14, 2016
@Wallethub
Copy link

@bpasero I'll post as soon as it happens again, I didn't look at arguments last time it did.

@bpasero bpasero assigned chrmarti and unassigned bpasero Sep 14, 2016
@cjdell
Copy link

cjdell commented Sep 14, 2016

May also be relevant, my project directory has 82097 files, though all but about 2000 of those files are excluded in settings.json.

@chrmarti
Copy link
Contributor

We've seen similar reports with many 'find' processes sticking around. So far I assumed these were triggered by #11181 because the user might have opened-closed QuickOpen a few times while 'find' is taking some time due to #11874, yet it seems there is more to it.

Any idea why 'find' might stay around?

@cjdell To confirm this is something else: Could you run time (find -L . -type f | wc -c); echo $? and time (find -L . -type f | wc -l); echo $? in your project folder and paste the output here?

@imsky
Copy link

imsky commented Sep 14, 2016

happening to me as well

CPU hog is this command:

/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap --type=watcherService

@jameslaneconkling
Copy link

jameslaneconkling commented Sep 14, 2016

I'm experiencing something similar to @cjdell: vs code spins up a bunch of 'find' processes that eat up a huge amount of CPU time when searching for files, and searching for files hang. The project I'm running into this with has a huge dependency tree, all of which should be excluded by the files.exclude setting.

Am not experiencing the same issue in smaller projects.

This was not an issue before this morning, when I updated to 1.5.2 (not sure what my previous version was...).

@cjdell
Copy link

cjdell commented Sep 15, 2016

@chrmarti

Chriss-MBP:ember chrisdell$ time (find -L . -type f | wc -c); echo $?
 89110263

real    0m18.543s
user    0m1.889s
sys 0m13.489s
0
Chriss-MBP:ember chrisdell$ time (find -L . -type f | wc -l); echo $?
  860093

real    0m14.717s
user    0m1.503s
sys 0m11.950s
0

@cjdell
Copy link

cjdell commented Sep 15, 2016

@bpasero The Code Helper process taking 100% CPU is now the watcherService. So it isn't just the searchService.

@bpasero
Copy link
Member

bpasero commented Sep 15, 2016

@cjdell then it could be #3998

@cjdell
Copy link

cjdell commented Sep 15, 2016

@bpasero Thanks, I've added the files.watcherExclude setting, I was previously unaware of this. It appears to have made a difference. The Code Helper now settles down a few minutes after spooling up. This maybe the best solution (for now) for anyone experiencing this problem. I can see this was mentioned in the release notes a while ago but it appears many people still aren't aware of it.

@cjdell
Copy link

cjdell commented Sep 15, 2016

Whilst the Code Helper isn't hogging the CPU anymore. Still occasionally seeing 10+ find processes suddenly appear when I do a file search within Code. They will hog the CPU for a few minutes then die. The processes have this line: find -L . -type f

@chrmarti
Copy link
Contributor

@cjdell We are using find for speeding up the file search in the file opener (Cmd+P). There is a performance regression with that in 1.5.2 when there are large excluded folders which is fixed with #11874 in the 'insiders' build.

@cjdell
Copy link

cjdell commented Sep 15, 2016

@chrmarti Just trying the insiders build now. Still has the nasty find bug I'm afraid. I can easily replicate it by using the file opener (Cmd+P) and just constantly typing characters. It's like it's launching find processes for every key press! It will bring my system to its knees very quickly (stuttering mouse cursor). Clearly there needs to be a lock or debounce put in somewhere :-)

@chrmarti
Copy link
Contributor

@cjdell That's an interesting data point, I haven't been able to reproduce that. Could you share your user and workspace settings with us?

@cjdell
Copy link

cjdell commented Sep 15, 2016

@chrmarti I'm on entirely default settings apart my excludes:

{
  "files.exclude": {
    "**/tmp/**": true,
    "**/node_modules/**": true,
    "**/bower_components/**": true
  },
  "files.watcherExclude": {
    "**/tmp/**": true,
    "**/node_modules/**": true,
    "**/bower_components/**": true
  }
}

My project is pretty large though (not enormous) so I'm sure that's a contributing factor. I posted the stats earlier on this issue. It's an Ember project that I'm working on.

@chrmarti
Copy link
Contributor

@cjdell You might hit a limitation of our glob optimizations. Could you remove the trailing '/**' from the files.exclude patterns and retry? That should make my fix from yesterday actually work.

@dansmith-pki
Copy link

I found a workaround for extension host generating high CPU and requiring a window reload. In my case at least, when I save a file I see the "git" process running high CPU usage and then the extension helper using up lots of CPU and eventually dying.

My situation: I have a git repo in my home directory for managing a handful of dot-files but no git repo inside my development subdirectory. The cmd-line git client shows only a few files being actively managed by git and hundreds of untracked files / dirs. I suspect that the VSC git process is trawling this entire repository; whereas the cmd-line git client returns immediately with the status. Walking the filesystem is really slow: shell$ find ~ -type f | wc -l requires more than 30 seconds to complete due to hundreds of thousands of files in the OS X Library directory, ~/Library.

Workaround: Doing a git init in my project directory created an empty git repo that that superseded the repo in ~. I now see the Code Helper process peak slightly the first time I save a file and is fine on subsequent saves.

@jukbot
Copy link

jukbot commented May 1, 2017

me too same problem here

@cwtuan
Copy link

cwtuan commented May 11, 2017

image

Same problem at mac air
vs code: 1.12.1

@eliysha
Copy link

eliysha commented May 12, 2017

Same here
screen shot 2017-05-12 at 16 06 33

VS CODE : 1.12.1

@etoews
Copy link

etoews commented May 17, 2017

In my case the extension causing the extended CPU spike was Code Spellchecker (ping @Jason-Rev).

I uninstalled the extension, force quit that particular Code Helper process in the Mac's Activity Monitor app, and restarted VS Code. My laptop fan is much happier now.

Of note, I installed Code Spellchecker a couple of weeks ago and didn't have any issues. It wasn't until VS Code updated to v1.12.2 a couple of days ago that the CPU spike started happening.

Versions

VS Code: 1.12.2
Mac: Sierra 10.12.4

I found the extension causing the CPU spike by finding the PID in the Activity Monitor and then
$ ps aux | grep 85402
everett          85402 100.0  0.5  3270148  90396   ??  R     7:26AM 145:51.39 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Users/everett/.vscode/extensions/streetsidesoftware.code-spell-checker-1.1.0/node_modules/vscode-languageclient/lib/utils/electronForkStart /Users/everett/.vscode/extensions/streetsidesoftware.code-spell-checker-1.1.0/server/src/server.js --node-ipc

@Jason3S
Copy link

Jason3S commented May 18, 2017

I have seen and issue with the VS Code update process (Updating VS Code, not the extensions), where the extension does not shut down. When that happens, the orphaned extension can end up using a lot of CPU power.

@everett-toews If you re-install the spell checker, does it still use a lot of CPU?

@etoews
Copy link

etoews commented May 18, 2017

@Jason3S Thanks for getting back to me. I reinstalled Code Spellchecker and it's still using a lot of CPU. I started a tracking issue in streetsidesoftware/vscode-spell-checker#94

@IdealBoy709
Copy link

➜ ~
➜ ~ ps aux | grep 4532
macbook 4532 114.1 12.1 4722660 1014916 ?? R 7:02下午 23:50.65 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap --type=searchService
root 237 0.0 0.1 2453276 9876 ?? Ss 9:09上午 0:00.21 /usr/libexec/thermald
macbook 4985 0.0 0.0 2432804 1716 s000 R+ 7:22下午 0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn 4532

Sampling process 4532 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling Code Helper (pid 4532) every 1 millisecond
Process: Code Helper [4532]
Path: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper
Load Address: 0x10a8c4000
Identifier: Code Helper
Version: ???
Code Type: X86-64
Parent Process: Code Helper [4526]

Date/Time: 2017-05-23 19:41:19.378 +0800
Launch Time: 2017-05-23 19:02:46.699 +0800
OS Version: Mac OS X 10.12.5 (16F73)
Report Version: 7
Analysis Tool: /usr/bin/sample

@maxbureac
Copy link

maxbureac commented Jun 8, 2017

same here:
cwd
/
txt
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper
txt
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework
txt
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/Squirrel.framework/Versions/A/Squirrel
txt
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/ReactiveCocoa
txt
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/Mantle.framework/Versions/A/Mantle
txt
/usr/lib/libSystem.B.dylib
txt
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
txt
/System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia
txt
/System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI
txt
/usr/lib/libsandbox.1.dylib
txt
/usr/lib/system/libdispatch.dylib
txt
/usr/lib/system/libdyld.dylib
txt
/usr/lib/system/liblaunch.dylib
txt
/usr/lib/system/libmacho.dylib
txt
/usr/lib/system/libquarantine.dylib
txt
/usr/lib/system/libsystem_configuration.dylib
txt
/usr/lib/system/libsystem_coreservices.dylib
txt
/usr/lib/system/libsystem_dnssd.dylib
txt
/usr/lib/system/libsystem_info.dylib
txt
/usr/lib/system/libsystem_sandbox.dylib
txt
/usr/lib/dyld
txt
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib
txt
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libffmpeg.dylib
txt
/System/Library/Frameworks/AVFoundation.framework/Versions/A/AVFoundation
txt
/System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
txt
/usr/lib/system/libsystem_c.dylib
txt
/usr/lib/system/libsystem_kernel.dylib
txt
/usr/lib/system/libsystem_m.dylib
txt
/usr/lib/system/libsystem_malloc.dylib
txt
/usr/lib/system/libsystem_network.dylib
txt
/usr/lib/system/libsystem_networkextension.dylib
txt
/usr/lib/system/libsystem_platform.dylib
txt
/usr/lib/system/libsystem_pthread.dylib
txt
/usr/lib/system/libsystem_secinit.dylib
txt
/usr/lib/system/libsystem_symptoms.dylib
txt
/usr/lib/system/libsystem_trace.dylib
txt
/usr/lib/system/libxpc.dylib
txt
/usr/lib/libsqlite3.dylib
txt
/usr/lib/libnetwork.dylib
txt
/usr/lib/system/libkxld.dylib
txt
/System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement
txt
/System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay
txt
/System/Library/Frameworks/MediaToolbox.framework/Versions/A/MediaToolbox
txt
/System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox
txt
/usr/lib/libMatch.1.dylib
txt
/usr/lib/libexpat.1.dylib
txt
/usr/share/icu/icudt57l.dat
txt
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/icudtl.dat
txt
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/snapshot_blob.bin
txt
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/natives_blob.bin
txt
/private/var/db/dyld/dyld_shared_cache_x86_64
0
/dev/null
1
/dev/null
2
/dev/null
3
->0x46b5c6571845ef01
4
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/icudtl.dat
5
->0x46b5c6571845f609
6
->0x46b5c657150ec791
7
->0x46b5c657150ec011
8
count=1, state=0x8
9
->0x46b5c657150eb7d1
10
->0x46b5c657150eb711
11
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/icudtl.dat
12
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/snapshot_blob.bin
13
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/natives_blob.bin
14
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/en.lproj/locale.pak
15
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/content_shell.pak
16
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/pdf_viewer_resources.pak
17
->0x46b5c657150eca91
18
->0x46b5c657150ec9d1
19
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/snapshot_blob.bin
20
/dev/urandom
21
->0x46b5c6571845ddd1
22
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Resources/electron.asar
23
/private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/93EB8CFA-1CD5-4DA1-AA2B-EE71939270CB/d/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/natives_blob.bin
24
/dev/urandom
25
/dev/null
26
->0x46b5c6571845df61
27
*:54554
28
/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/vscode-935f02cfd6e5296f0cdf0d53bee0ed50db425f6f.sock
29
30
->0x46b5c6571845db79
31
->0x46b5c65711d72bd9
32
/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/vscode-50f5a9fa930bd883ba56eb5b853a69e8da82da3b.sock
33
->0x46b5c6571845de99
34
->0x46b5c6571d2ea219
35
->0x46b5c6571845f2e9
36
/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/vscode-462be0cfa47ca57f310c68ecebca5df3682debad.sock
37
->0x46b5c6571845e8c1
38
->0x46b5c6571d2ec929
39
->0x46b5c6571d2ea2e1
40
->0x46b5c6571d2ec861
41
/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/vscode-b817d9a84bbdeba3ef2ee6c3d5a68be35f060e7e.sock
42
->0x46b5c6571d2eb0f1
43
->0x46b5c6571d2eac41
44
/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/vscode-4ebe438d8d1fa3833c57bc1d226faec66226a696.sock
45
->0x46b5c6571d2eba51
46
->0x46b5c6571d2eb4d9
47
->0x46b5c6571d2ebb19
48
/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/vscode-935f02cfd6e5296f0cdf0d53bee0ed50db425f6f.sock
49
->0x46b5c6571d2ea3a9
50
51
->0x46b5c6571d2ea921
52
->0x46b5c6570e906861
53
->0x46b5c6571d2ebfc9
54
55
/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/vscode-50f5a9fa930bd883ba56eb5b853a69e8da82da3b.sock
56
->0x46b5c6570e906541
57
/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/vscode-462be0cfa47ca57f310c68ecebca5df3682debad.sock
58
->0x46b5c6570e905d71
59
/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/vscode-4ebe438d8d1fa3833c57bc1d226faec66226a696.sock
60
/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/vscode-b817d9a84bbdeba3ef2ee6c3d5a68be35f060e7e.sock
61
->0x46b5c6571587e151
62
/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/vscode-7fc0d207926be6b8aa062b24067db088dca550c5.sock
63
/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/vscode-ac350306db8abc0ad7b45d9f15e645646e563012.sock
64
->0x46b5c65711d74669
65
/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/vscode-7fc0d207926be6b8aa062b24067db088dca550c5.sock
66
->0x46b5c65711d72e31
67
->0x46b5c6570d0a1ca1
68
->0x46b5c65711d74281
69
->0x46b5c6570d0a2c41
70
->0x46b5c65711d753b1
71
/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/vscode-ac350306db8abc0ad7b45d9f15e645646e563012.sock
72
->0x46b5c6570d0a4159
73
->0x46b5c65706bb2281
74
->0x46b5c6570d0a2ab1
76
->0x46b5c6570d0a4799
screen shot 2017-06-09 at 12 19 23 am

ps aux | grep 4881
maximbureac 4881 99.6 0.4 3262696 29380 ?? R 10:16AM 52:00.41 /private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/AF6ABAD4-601E-4106-A984-1E608C9BCFB7/d/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /private/var/folders/0r/t0zywvrd7fj8vg_jqbmmsbzc0000gn/T/AppTranslocation/AF6ABAD4-601E-4106-A984-1E608C9BCFB7/d/Visual Studio Code.app/Contents/Resources/app/out/bootstrap --type=extensionHost
maximbureac 7784 0.0 0.0 2443044 1952 s004 S+ 11:44AM 0:00.00 grep 4881

@cevarief
Copy link

Suddenly it happens again when opening bootstrap admin theme from https://www.creative-tim.com/product/light-bootstrap-dashboard.
Theres not much file in the folder. CPU usage is around 98%.
VSCode Version 1.13.1 ~ Sierra 10.12.5

@chrmarti
Copy link
Contributor

@cevarief Could you open a new issue (Help > Report Issues) and include the command line arguments of the process causing the high cpu usage? (This likely a new issue.)

@cevarief
Copy link

Hi @chrmarti, Yes sure. Thank you.

@larssn
Copy link

larssn commented Jun 22, 2017

Happening to me at random. I have to quit vscode, and terminate the orphaned high cpu usage CodeHelper manually. This is in OSX Sierra.

@hudidit
Copy link

hudidit commented Jun 27, 2017

I've disabled all installed extensions and this problem is still with me.

Every time I open a .js file in Code, this happens. And when I typed ps aux | grep Code in terminal, I got the first row of results like below:
MyUsername 4380 100.0 0.9 3210240 73784 ?? R 3:52下午 1:03.98 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /usr/local/lib/node_modules/typescript/lib/typingsInstaller.js --globalTypingsCacheLocation /Users/lanhaihy/Library/Caches/typescript --enableTelemetry.

Looks like it's typingsInstaller.js causing the problem. This file has over 7k lines of code. Seems un-debuggable to me. Please help.

-- update1 (workaround) --
A temporary workaround is to delete /usr/local/lib/node_modules/typescript, so there would be no typingsInstaller.js to run. As of now, the only effect that I noticed is that a prompt pops up every time I open a new window. Doesn't affect my developing so far.

-- update2 --
At my guess, adding following configs prevent VSCode from indexing too many directories. They're also needed besides the typingsinstaller.js workaround.

{
    "files.exclude": { /* blabla... */ },
    "files.watcherExclude": { /* blabla... */ }
}

@trivita
Copy link

trivita commented Jul 16, 2017

why is this issue closed? i just had this. code helper 100% cpu on each core. and then after code helper shut itself down. the find process went to 100%

latest everything

@Jason3S
Copy link

Jason3S commented Jul 17, 2017

@trivita I suggest opening a new issue. Each one of these Code Helpers can have a different cause.

@Jason3S
Copy link

Jason3S commented Jul 17, 2017

@trivita is it related to this issue? #30874

@AriTheElk
Copy link

Since my last response in this thread, I've switched to windows 10 full time (surface pro). I have the exact same extensions installed as on my macbook pro, and there is absolutely no issues with high CPU usage or memory leaks.

Probably not helpful info to most, but this confirms that it's isolated on macOS (even if extensions are to blame).

@fedekau
Copy link

fedekau commented Jul 25, 2017

I experienced the same problems in (version 1.14.2) with a really big project. By adding the following config and restarting the editor it seems to be resolved:

{
    "files.exclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/CVS": true,
        "**/.DS_Store": true,
        "**/tmp": true,
        "**/node_modules": true,
        "**/bower_components": true,
        "**/dist": true
    },
    "files.watcherExclude": {
        "**/.git/objects/**": true,
        "**/.git/subtree-cache/**": true,
        "**/node_modules/**": true,
        "**/tmp/**": true,
        "**/bower_components/**": true,
        "**/dist/**": true
    }
}

The Code Helper process went from 1.5GB to 150MB RAM

@GuyHarwood
Copy link

GuyHarwood commented Aug 4, 2017

It's also worth noting that if you tend to keep a vsCode window open in a large 'non project' folder (such as your user home directory), the Code Helper is naturally going to soak up a lot of resource as it tries to parse every sub directory.

Using the above as a starting point, you can create greedy exclusion patterns that prevent the Code Helper from going any further than your root directory.

@raphaelramalho
Copy link

@fedekau

I tried all the possible things:

  • Uninstall extensions one by one
  • Disable git in preferences
  • Among others

Some options even slowed down processing, but what really did effect was adding these settings you mentioned.

Thank you all!

@thematthopkins
Copy link

In my case this was caused by too many files in the project directory. VS Code starts a number of find processes w/ the form:

find -L . -type f

This has overhead, even for excluded/unwatched directories.

Running the command from the project directory ended yielded a massive number of files in ./tmp that were left over from some terminated node processes. Clearing out ./tmp resolved the issue.

@javenschuetz
Copy link

javenschuetz commented Oct 26, 2017

For me, even after closing the program I still have 99.2% cpu usage 10 minutes later (2015 mbp 13 inch, high sierra).

Why is the issue closed?

edit: tried fedekau's settings, seems to be working for now.

@jimblue
Copy link

jimblue commented Nov 8, 2017

Same problem here, VScode with 0 file open => 100% CPU usage (never go under 96%)

My laptop cant' cool down and my keyboard is burning!! (MBP retina 15" on High Sierra)
Can you please re open this issue...

My VScode settings:

"files.watcherExclude": {
        "**/.git/objects/**": true,
        "**/.git/subtree-cache/**": true,
        "**/node_modules/**": true,
        "**/vendor/**": true,
        "assets/**": true,
        "backup/**": true,
        "bin/**": true,
        "cache/**": true,
        "images/**": true,
        "logs/**": true,
        "system/**": true,
        "tmp/**": true,
        "webserver-configs/**": true
}

screen shot 2017-11-08 at 13 33 11

@Jason3S
Copy link

Jason3S commented Nov 8, 2017

@jimblue and @javenschuetz,

Please open a new issue and refer to this one.

@roblourens
Copy link
Member

I'm going to lock this issue - anyone with similar issues, please see https://github.com/Microsoft/vscode/wiki/Performance-Issues and open a new issue.

@microsoft microsoft locked and limited conversation to collaborators Nov 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests