-
Notifications
You must be signed in to change notification settings - Fork 29.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
editor becomes unresponsive all the time since last update #7391
Comments
Since the last update, the editor is very slow for me too. I'm on Mac (10.10.5) and I just upgraded to 1.2.0 EDIT: I run VS Code vanilla. No plugins. |
I am experiencing the same thing to plus saving the JS file the title are start to flicker and will not save. |
I am experiencing the same thing if i open a third file-tab. |
I'm also seeing a lot of freezing with the latest update. I can generally only go ~10 minutes between freezes, and when it freezes all I can do is kill the whole process. Is there somewhere we can look for crash dumps/log files? 1.2.0 on Ubuntu 14.04; I almost exclusively use VSCode for TypeScript. |
I am sorry you are experiencing this. To help us reproduce, can you please give us more details. Is there a common pattern between these freezes (I see that they occur on Windows 10, Windows 7, Ubuntu and Mac), so I'm thinking they are not OS specific (if they have the same root cause). What sort of languages are you working on? I see TypeScript and JavaScript mentioned. Is that true for everybody? We have had quite a few issues with the TS/JS grammars (sometimes they recurse to death). Is it possible that this happens when opening a certain file or a file containing a certain pattern that would cause the grammars to go crazy? We would appreciate any other details to repro this. |
Are you using the new integrated terminal? |
I'm not.
I tried it a bit more today, and, at least for me, it seems to always happen when I try to save. I press ctrl+S, but the save operation never completes (the black dot never goes away, and the file never actually gets saved). I then have to kill the process and try again. It happens maybe 5-10% of the time (or less) when I try to save (most save operations are successful and instant) The files I'm editing are on a networked filesystem, which might be related, though I'm confident that that's not the direct cause, because (a) this has always worked in previous versions and (b) I'm not seeing this problem in other editors, including a 1.1 install of VS Code. |
That's exactly the same thing for me, I think it might be .js file related because I have some html and php file open in different tabs and it never happened on those files, I initially thought it might be because the terminal was opened, but that wasn't the case, and I also thought it may be because their is a grunt watchify on the folders I am working on, but it's wasn't the case either, I have also started removing some plugins, which initially things seems fine, so I would attribute that to the plugin bug. But then I am still getting the same issue again. Windows 7 I installed V1.1 to see if I could revert back but that problem still occurred. Temporary solution for now is: It's a pain to work with now. I hope this is enough information. |
I am using VS code only for PHP programming. I could use it a few seconds, a couple of keystrokes and it would freeze and never wake up again. Even though all users are describing similar symptoms, we all seem to use it a tiny bit different and therefore it might all be related to completely different problems. Anyway, it works fine for me at the moment. Is there no debug more with log files or anything that we could append the next time this happens? |
@bpasero - The freezing problems just started again. I am using Smartgit on Windows 10, which includes some kind of git for windows. I changed the setting as you suggested, now it runs fine again, at least for the last half an hour. |
@preexo, what do you get when running |
@preexo can you quickly check if this is reproducible in our previous version (https://az764295.vo.msecnd.net/stable/def9e32467ad6e4f48787d38caf190acbfee5880/VSCode-darwin-stable-unsigned.zip). Make sure to enable git again. |
@joaomoreno -
@bpasero - your link looks like the OSX app, I am running windows 10. |
@bpasero - yes, I can reproduce it. Started the old version, changed the config back. The same thing happens with the version you gave me there. But it has never happened before. I was using the editor for a while already without trouble and never changed the git.enabled default value. |
I went back to 1.2.0 and disabled the git again... Just had another freeze. This is completely random. I don't think that this trial and error procedure will get us anywhere. Is there no debug mode and log file that would just tell you what actually goes wrong, where it explodes? |
@preexo are you restarting when making the git change? |
https://cloud.githubusercontent.com/assets/3006809/15963290/ad29f262-2f08-11e6-8c91-57f7fb0faad8.Gif Here is a screencast of the flickering |
@bpasero: Not using Git, though apparently I have 2.8.0 installed. Tried disabling it and that didn't fix it apparently. It happened again within a few minutes. |
@calebegg can you open the chrome developer tools and hit the profile button from the profile tab to measure a bit where this time is spend? |
@bpasero Any more updates on this? I see you tagged "needs more info" -- what can I do to help you diagnose? This is still happening very frequently for me. |
I tried using strace to attach to what I assume is the renderer process (I guessed that the one with highest CPU would be the renderer) and I found that right before vscode freezes, this process crashes, and it looks like it sends a crash report. Is there some data I can give to you to help track down the crash report on your end? The |
Best would be a memory profile when memory is growing but before VS Code crashes with out of memory (at ~1 GB). Typically the crash report does not help us much because it just indicates that there was an out of memory. It does not tell us which area caused it unfortunately. |
I found a good way to reproduce it consistently: I have a very large (1.7MB, 37K lines), generated .d.ts file as part of my project, and if i open it, VSCode crashes after a few seconds. I don't normally have to open it, but it seems that even if I edit a file that depends on it and do certain things, like hovering over a symbol in that file for a few seconds, VSCode (it looks like) tries to load/parse that large file, and crashes within a few seconds. While it's working, I see "Loading..." in the tooltip. Is there any way to make vscode never look at the file (only let the TS language service see it?) Maybe if this is a common problem, you could introduce a file size limit above which VSCode will not attempt to parse a file? Alternatively, is there a way to bump up the memory that VSCode will use so maybe it can parse the large file without choking? I have a heap snapshot from before the crash, at about 618 MB used. I also have a memory timeline. 82% of the retained size usage from the heap snapshot is instances of StackElement, which seems to be something to do with syntax highlighting as far as I can tell. In a "normal" (not about to crash) heap snapshot, StackElement takes up only 8KB. |
@calebegg are you able to attach this file here? |
Unfortunately, it contains proprietary code, but I will try to create a version of it without any. (It was generated with https://github.com/angular/clutz). |
Here's a similar file that kills my VSCode within a few seconds. 96K lines, 3.9MB. http://ca.lebe.gg/files/out.d.ts Like I said, I don't necessarily expect VSCode to be able to handle such large, generated files, but the problem is that if I depend on a symbol from this file elsewhere, it also seems to crash VSCode eventually. Also, if it helps, my deps on files of this size worked fine pre-1.2. This all only started with VSCode 1.2. |
@calebegg Thank you so much for the repro file! I can immediately reproduce. It is the TypeScript TM grammar. I have done the following change in our code: The grammar keeps on pushing states and never leaves them. Again!
This means that the grammar has a scope stack of depth 429, causing each token to have 429 scopes. It leads us to a DoS through OOM. I am not sure when we last updated the TS grammar and why it started showing up in 1.2. @aeschli ? |
@aeschli I can reproduce on master
So we need to assume the bad grammar change got in first in 1.2 |
It could also be that the pre-parsing of files that aren't open in the editor got introduced (I assume to speed up opening times) in 1.2. I have no idea, though. |
Removing my assignment since this is in very good hands. |
After adopting vscode-textmate@2.0.1 (see #7912) (where the StackElement is immutable) this .d.ts does not cause an OOM for me anymore: It is significant to note that the TypeScript grammar gets so broken for this example that at the end of the file it has entered 7152 rules that are not left!!! I will create a separate bug for them. The good thing is we no longer crash. |
Steps to Reproduce:
I just updated my Visual Studio Code to the latest version. Congratulations, since then it is unresponsive all the time. I can work for a few seconds, then I hit a key, it freezes and can only be solved by killing the process through task manager...
It was running nice and smooth before the latest update, which I got today. Sadly I can't work like this and need a reliable editor, so I have to go back to use something else now.
Good luck.
The text was updated successfully, but these errors were encountered: