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

Autocomplete slowing down after long time #28946

Closed
enbyted opened this issue Jun 17, 2017 · 9 comments
Closed

Autocomplete slowing down after long time #28946

enbyted opened this issue Jun 17, 2017 · 9 comments
Assignees
Labels
info-needed Issue requires more information from poster typescript Typescript support issues

Comments

@enbyted
Copy link

enbyted commented Jun 17, 2017

  • VSCode Version: 1.13.1
  • OS Version: WIndows 8.1 64-bit

This issue has been bugging me since I've started using VS Code, but I've never got around to reporting it.

I tend to not turn off my computer(or turn off programs) for long time and I've noticed that after about a week autocomplete in VS Code starts slowing down and after about 3-5 more days it stops working at all. All it takes to fix it is restart the VS Code, but it looks like some sort of memory leak somewhere.

I didn't notice, however, any memory usage increase over time.

Let me know what can I test to help pinpoint this issue.

@enbyted
Copy link
Author

enbyted commented Jun 17, 2017

@vscodebot[bot] I know you're just some script, but hey, it's not just new release! :D

@ramya-rao-a
Copy link
Contributor

@enbyted What programming language do you see this in?

@ramya-rao-a ramya-rao-a added the info-needed Issue requires more information from poster label Jun 18, 2017
@enbyted
Copy link
Author

enbyted commented Jun 18, 2017

It's TypeScript and I've just checked it doesn't affect JSON or pug files.

Oh, and it prevent's any kind of autocomplete from happenig even snippets - it's loading forever.

@enbyted
Copy link
Author

enbyted commented Jun 18, 2017

It also prevents error highlighting, i.e. it won't underline invalid types or even syntax errors.

I don't have machine with VS Code with this problem triggered available right now, if Windows Update didn't reboot the computer I'll have access to it on Monday.
I've also been noticing this issue on Ubuntu.

It also appears that it's connected with actually using the autocomplete, I mean if I have a VS Code instance running but not actually coding much it won't happen.

@ramya-rao-a ramya-rao-a added typescript Typescript support issues and removed info-needed Issue requires more information from poster labels Jun 18, 2017
@enbyted
Copy link
Author

enbyted commented Jun 19, 2017

I'm not sure if this is the same issue, but I've just encountered this type of error on Insiders build.

It crashed suddenly, after a minor slowdown. As you can see on the screenshot it shows type error in invalid location. After closing this tab and opening again there isn't any kind of error underlining, the 'problems' tab is empty (even though there are problems with the code). Autocomplete is not showing typescript related stuff - it works as if it didn't know the language.

autocomplete_error

Stacktrace:

/C:/Program Files (x86)/Microsoft VS Code Insiders/resources/app/out/vs/workbench/electron-browser/workbench.main.js:29 Error processing request. Debug Failure. 
Error: Debug Failure. 
    at tryReuseStructureFromOldProgram (c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:56995:22)
    at Object.createProgram (c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:56815:34)
    at synchronizeHostData (c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:74265:33)
    at Object.getProgram (c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:74323:13)
    at ConfiguredProject.Project.updateGraphWorker (c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:77189:53)
    at ConfiguredProject.Project.updateGraph (c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:77147:39)
    at ConfiguredProject.Project.getLanguageService (c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:76920:26)
    at IOSession.Session.getCodeFixes (c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:80503:43)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:79449:61)
    at c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:80648:88

@mjbvz
Copy link
Collaborator

mjbvz commented Jun 21, 2017

That debug failure looks like this bug: microsoft/TypeScript#16591 This should be fixed once we pick up the final version of TypeScript 2.4

The problem with misplaced/missing errors seems like: #28630

@enbyted
Copy link
Author

enbyted commented Jun 22, 2017

That debug failure looks like this bug: microsoft/TypeScript#16591 This should be fixed once we pick up the final version of TypeScript 2.4

Yes, that's exactly what causes the crash that I've posted.

That means that it's probably unrelated to the slowing down thing that I've experienced. However I didn't experience it yet in Saturday's (I think) insiders build, so maybe it got fixed by TS 2.4 or something. It's been running stably for 5 days now in 3 instances with small(50 files) to medium (8k-10k files + dependencies) sized TS projects.

I'll observe it for next week or so and close this issue if nothing comes up. If that's okay with you.

I'll also run an instance on Ubuntu machine on which I've first noticed this issue it won't be heavily used though.

What can I check/test if I come across this problem? I imagine there won't be any crash and/or stacktrace right available because something is probably hanging rather than crashing (hence the forever loading symptom).

@mjbvz
Copy link
Collaborator

mjbvz commented Jun 27, 2017

If you are still running into this issue, try collecting the TypeScript server logs. These logs contain detailed information about the time required to compute for each response:

  1. Set "typescript.tsserver.log": "verbose"
  2. Restart VSCode
  3. Reproduce the issue
  4. Run the Open TSServer log File command and view the tsserver.log file

Look for entries in the log for suggestions requests. You can also try searching for requests that take a long time to return.

If you can share the ts log file I can take a look through them to see if anything stands out

⚠️Warning: The TypeScript log may include information from your workspace, including file paths and source code. If you have any concerns about posting this publicly on Github, just let me know and we can arrange something else. On our side, we only use these logs to investigate issues like this

@mjbvz mjbvz added the info-needed Issue requires more information from poster label Jun 27, 2017
@enbyted
Copy link
Author

enbyted commented Jul 1, 2017

I've noticed it with normal version (without logging enabled unfortunately) but not on insiders. Seems like typescript 2.4 fixes it - I'm closing this.

@enbyted enbyted closed this as completed Jul 1, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

3 participants