-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
VSCode eats memory and slows down my Macbook Pro #6026
Comments
@rockymontana does this happen on all workspaces you open or maybe only on a very large one? |
The one I use now isnt very large. But yeah... When you mention it, I did uncheck an "ignore node_modules" for indexing (I guess?). And on that note - filtering on folder names when one starts to type in focused tree mode would be soooooo awesome :-)
|
@rockymontana what exactly did you uncheck and how and where? |
I've noticed this recently, same versions of OS X/VS Code. It's a medium sized project consisting of a couple node apps and a small website, I originally noticed it a few days ago when the typescript autocomplete was taking forever to load and eventually stopped working - I restarted VSCode and it would work again. I since noticed my whole machine. Trying to work out what's causing it just now, but it looks like just opening a few js/ts/json files into the working file list caused it to use over 1.1GB of memory. I switched between debug/search/git tabs and it didn't seem to have an immediate effect, but in the few minutes I've written this it's now idling on 1.4GB. |
@coggers can you please find out which of the multiple processes Code spawns is the one with a lot of memory in your case? |
@bpasero It's Electron Helper |
@coggers we need more info, the full command line of the helper! E.g. |
@bpasero same problem here, my process information:
|
@tan9 that looks like the JSCS linter given the path of the 100% CPU. Please report to https://github.com/Microsoft/vscode-jscs @rockymontana |
I'm having a similar issue. Electron Helper is taking 50-150% CPU and eating up memory. This only happened since my update to version 1.2.0. It is happening while I have a react native project open with lots of node_modules inside. My
|
I am very sorry to hear you are having issues with VS Code. I wonder if this issue is being caused by an installed extension. Can you try to run VS Code without extensions? From the command line, execute: |
OK I ran it again without extensions but still have the problem. Additionally I have tried to exclude the node_modules folder in the project, but the problem still occurs - after about 5 minutes, the CPU of Electron Helper went up to around 100%. |
@epaga can you find out the full command line arguments and executable of the helper? we spawn many. |
Pretty sure it's the
on the first post I made, but I will double-check |
Yep here it is, this time with --disable-extensions. Note the "112.0" which is the CPU.
|
@rockymontana @epaga can you guys try to run a chrome developer tools profile to see where the time is spend? you can bring up developer tools from the help menu and start the profile from the profile tab. |
I am very greatful that this issue has been brought back to life. Sorry for the bad news… When you get Code stable enough I will switch back since I liked its' minimalistic interface, and I'm not a very big fan of Atom. So I'll check back in with you in a couple of versions when the "child deceases" (does one even say that in english or is it just us northern folk? ;) ) are taken care of. Best of luck to you! From: Benjamin Pasero @rockymontana @epaga can you guys try to run a chrome developer tools profile to see where the time is spend? you can bring up developer tools from the help menu and start the profile from the profile tab. — |
94% of the CPU time is being spent in the function Let me know if you need further info. This took me literally 1 minute. |
@epaga great findings and this is exactly what we have seen in #7428 We still have to find out which of our processes is causing this flood of messages (extension host, search, file events). Can you try to run from command line |
OK, I ran |
@epaga Any change you can put a breakpoint in that |
Over 5000 changes. Note that these are active changes, not files in repository. |
Seems to be fine now. But I still find it a bit excessive to scan all changed files in the tree after every change to a single file. |
Kickass work and thanks a lot and sorry for being unhelpful earlier. |
The problem seems to have been resolved in the Insider build, but seems to still exist on v1.2.1. Anyhow, thank you for this. I missed VS Code the past few days. |
@apratheek Ultimately, the issue is due to the user having initialised a git repository where one would not do so normally. The typical cases we saw have initialised one in their home folder. The real fix here is to remove that git repository. I suggest you do the same. The fix we pushed simply mitigates this and prevents the browser window from slowness. |
I see mentions of unbounded json string buffers growing due to lack of |
This is still happening for me on 1.3.1, OSX. It happens as soon as I open my project folder. It isn't a big project at all, except for the node_modules that, as is often the case in the node ecosystem, is surprisingly big. I'm only using 4 plugins: ESLint, OpenVim, Debugger for Chrome and Vim emulation. I've tried excluding node_modules from indexing, to no effect: "search.exclude": {
"**/.git": true,
"**/node_modules": true,
"**/bower_components": true,
"**/tmp": true
} Addendum: Electron helper keeps running after I command+Q VSCode, but I've checked that it's its Electorn Helper process and not some other electron-based app. |
@jkurei What do you get with Also, what exactly is happening? |
What happens is that Electorn Helper is eating 100% CPU and around 650MiB of Ram. My main issue is with the cpu, and my computer running its fans as if it wanted to take fly, I don't know how absurdly hight that RAM consumption is. Right now git status shows:
But i've had this same issue for a couple of days, also without any |
I may have tracked it down. Yesterday I added .vscode to my .gitignore, but I didn't force quit the Electron Helper process. Now with .vscode git-ignored, Electron Helper's CPU usage is only high right after starting VSCode. I'll test this out a bit more... UPDATE: 😞 Nah, it's back at it; didn't change but a couple of js files. |
How many changes does the git view report? |
The same issue here. Fans crazy, code helper process eating 100,5% of the cpu and vbcode freezing at every key (press 1 key, wait 3 seconds or so, then the key is in the screen). |
I have noticed which the last update of the vscode have increases the memory usage, as an memory leak, I don't know the reason of that. |
It looks like to be the git extension again :(, I deleted the .git repository and this works fine. |
@RavenCrow @caiocutrim Please create new issues for whatever you are seeing, and try to provide as much information as you can. |
|
It's consuming almost 2Gb of RAM and 98% of CPU with some PHP and Python extensions. VSCode killed my i3 Dell laptop. |
@leandroramos That sounds like a problem with the extensions, not with vscode. Log an issue with the authors. |
I've just experienced a very similar issue (maybe the same) on my pristine MacBook Pro (opened yesterday) running Mac OS 10.12.6. I installed VS code last night, I have 0 extensions installed and had nothing previously open in the app. crashpad_handler was using 130% CPU (Explained why the MacBook was huffing and puffing) I was not actively using VS Code!. When I used force quit on the process it crashed VS Code. As it happens googling crashpad_handler brought me here anyway. |
Anyone got a good one-liner to quit all of these This is a constant issue for me. After awhile of working, I'll notice my CPU starts to go nuts. Then, I exit
My usual process is to go in and kill these by clicking one by one in the Activity Monitor. Would love for these to not exist anymore :/ but was curious if anyone had a good copy paste snippet to blow them all out at once (for now). |
fyi @dbaeumer see last comment |
@alexandrudima thanks. Since this leaks LSP servers and TS I assume that the extension host didn't shutdown correctly. I did add code to the LSP that even without initialization installs a watch dog, but that one requires the node event loop being alive. Could I use your C++ implementation. It would be a check of a process id? |
@dbaeumer I pinged because from the list of processes, none of them are the extension host. The |
@alexandrudima agree with the list but the tsserver is in there are well. So not only a LSP issue :-) |
I am also seeing this issue in my Macbook Pro. It slows down my machine and when I am typing, also it shows 1 character in the time of typing 3 characters. My machine has 16GB RAM and i7 processor running. |
Steps to Reproduce:
One plausable reason:
However:
Even though I did stop the npm stuff (didn't uninstall it though) it still drains my computer of all its powers.
So I'm not 100% sure it relates to the extension.
I'm sorry if this bug report is hard to understand. I'm writing this out of memory. I can try and reproduce it and update it if you haven't heard anything about this before.
The text was updated successfully, but these errors were encountered: