-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
BUG: High Energy Impact. #774
Comments
This can be anything, from a plugin eating lots of CPU to the file watcher. Can you share more about the environment and project. |
I have no additional plugins installed. Installed version of code: 7cc0c60 in a default state. AutoSave is turned off. OSX10.11 GIT is enabled for the current project. The next time it triggers again, i'll make sure to log what i'm doing. |
Yeah the size and kind of workspace you open also plays a role. |
The current project I'm working on is 100MB with 7,163 files mainly PHP. I have about 20 open in the |
I wonder if the PHP process we spawn for linting could have an impact, @aeschli is there a way to trace this? |
Are you on 0.10.2? |
Currently 0.10.2 I can't be sure at which point I upgraded (unhelpful). It may have been recently. I can keep working to see if the issue returns. While I didn't check the CPU, as the editor still worked absolutely fine it couldn't have been maxing out. The only reason I noticed a problem was because the battery drained more rapidly than usual. I then checked and it had been running at 99.9 energy impact. The editor itself was very responsive. |
With bug #160, the extension host process would run in an endless loop. The editor was not affected, but validation, intellisense and hover would not work anymore. |
Fair enough - I can't say I would have missed those so could be the same issue. I'll check my other computers when I get back to make sure they are all running the latest 0.10.2 |
Ok please reopen then if you still see it with latest. |
Still have this issue on 0.10.6. As usual i will open 2 project(folder), one is php and the another is javascript. How can i commit a log or other things in details? |
@ccimage What if you open only the JavaScript project? The JavaScript language service is doing real work as it needs to analyze and open potentially all files in folder and subfolders. For PHP, did you configure the PHP command? If not. it should not consume much. |
@aeschli Sorry, i do not known the status about PHP command, actually i don't known what is this mean. I'm new on PHP. |
Can people seeing this issue with a JavaScript workspace please give our insiders build a try (https://code.visualstudio.com/insiders) and enable Salsa: https://github.com/Microsoft/vscode-docs/blob/master/release-notes/latest.md#javascript---salsa-preview |
@bpasero I see this issue with Insiders (0.10.8) and Salsa enabled, pretty consistently running at a high energy impact (OSX) |
Did a little poking around, in my project, I had a large dir that I had included in |
@chiangf can you please verify that adding the large dir to exclude really is the source of the high CPU use? does the CPU change just by making a change to this setting? If so, which one? |
@bpasero I think the high CPU use was definitely due to the large dir (it was a few gigs in size), which is understandable if the entire dir is being processed. After clearing out the large dir, the CPU use dropped instantly to a very normal amount. But the large dir was in the list of |
@awgeorge @ccimage @chiangf is one of you able to do a little experiment? I am speculating that maybe our library for file watching is failing. The steps would be:
For me (since fsevents works ok), I get this: If something goes wrong, I would expect fsevents to print as undefined. In that case, can you put another console.log inside the try/catch block of line 7 to see what the error is loading that native module? Thanks! |
We found out about the issue and here is what happens:
We also verified that chokidar was not falling back to polling. The fixes for March are:
For the future, we are looking into #3998 |
👌🏼 Sent from my iPhone
|
I may have some more information. I have a large project with many JavaScript files. I also usually have several Code instances open on different projects directories. I'm starting to get "Too many files open" errors and Code will become confused. Sections of the editor display won't update and CPU usage seems high. Restarting Code seems to clear things up. Could it be that Code is not closing files? |
I think for March this could be better, we reduce the number of open file watchers for working files and you have the option to exclude files from watching. I suggest we give March a try and you open a new issue if that does not help. |
Not sure how I can help debug this, whilst
code
is running in the background, it has a detrimental effect on the performance of the battery.The text was updated successfully, but these errors were encountered: