-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Visual Studio 2015 Out of Memory Crash (reproducible) #17569
Comments
I don't suppose you have a machine with either a) VS 2017 or b) TypeScript 2.4 (or preferably a VS 2017 machine with TS 2.4) to see if this issue still occurs? One of the most useful pieces of info before we investigate further is to know if we've already fixed it ;-) |
I'll see what I can do, I'm not sure if the project will run in VS 2017 community edition (we only have enterprise licenses for VS 2015), but I'll give it a try and report back. |
@billti & @bowdenk7 The issue, I don't have type autocomplete intellisense in TS files! (working correctly in C# files) |
Is this with the same project? Are you only seeing intellisense issues with the same problematic project? i.e. if you create a new empty ASP.NET app and add a TypeScript file, do you get intellisense working fine there? |
Both the existing problematic project and a brand new ASP.NET project with a new TS file are having the auto completion issue. |
The fact the error list is updating as you type (I assume you don't need to build to see the errors) indicates the language service is working. The fact you get intellisense in other languages and also it is appearing for keywords shows the completion list is functioning. So this is bizarre. I wonder if it may be the command-handler not responding as you type certain keys. If in a TypeScript file you type "document." do you not see the completion list after the dot with "addEventListener" etc.? If not, with the cursor positioned after the dot, if you select from the menu "Edit / Intellisense / List members" does anything appear? |
If I type 'document' (I also tested with several other global objects as well as some custom objects imported via 'import ...' statements) I do see a full list of members (including fields, methods, interfaces, everything). It's specifically type completion that's not working. After typing the colon ':' after a parameter, closing method parenthesis, field name, or local variable name I don't get anything. |
The editor doesn't automatically pop-up a list of types once in a type position, but once you start typing, you should get a completion list of all identifiers (including types) in scope, as shown below for a var or param type. Do you see similar behavior? That is the current design. (There are a number of places where it could filter to just the semantically valid items, but that work hasn't been done yet). |
I see what you mean, but I never get autocomplete lists in type positions, if I type |
Yeah, Screen2Gif is a handy tool :-) If everything else is functioning fine, the only reason I can think is if the options have it turned off. Could you check under Tools / Options the values you have for "Text Editor / All languages / General / Auto-list members", and "Text Editor / JavaScript/TypeScript / General / Auto-list members". If I switch these off, I get the behavior you describe. (And these settings can roam across installs when you sign-in, which is why you'd see it even on a clean install). |
I checked both of those settings are checkmarked in VS2017, I tried unchecking them and that caused all autocomplete to disappear, and rechecking them and the old behavior came back. See gif below for example in VS2017. Notice how I get member auto-complete lists for |
That's bizarre. If you hit Ctrl+Space after typing say "var x: Doc" does the expected completion list appear (i.e. if you trigger it manually)? |
p.s. You are definitely typing in a "*.ts" or a ".tsx" extension file right, and not a *.js file. Do you have any other extensions installed that may be interfering? |
When I pause in that gif after typing |
Interestingly, I just got pointed to this bug/description, which sounds quite likely (though I still don't understand why I'm not seeing it, but we may have different project structure/settings which comes into play): #16610 (comment) There are two ways we can see if this is the issue:
If you want to enable logging, set an environment var before launching VS as per these instructions If you want to try the fix, (temporarily) backup the tsserver.js file under ""C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.4\tsserver.js"", and replace it with the version from https://raw.githubusercontent.com/Microsoft/TypeScript/release-2.4/lib/tsserver.js . Let me know if either of these point to this as being the root cause. |
It worked! I enabled logging, saw the same forEach error mentioned in the thread you linked to. Tried the newer tsserver.js file and auto-complete is working! I'll try using VS2017 over the next few days and let you know if I encounter any out of memory crashes. On a side note, I've often noticed that the VS plugin updates are released several days or 1-2 weeks after a release here on github. Is there some type of beta channel for Visual Studio where I can get patches (like 2.4.2) quicker? |
we release the TS compiler/tsserver as an out of band release. you can get any version from https://www.microsoft.com/en-us/download/details.aspx?id=55258. TS 2.5-rc is out today, give it a try. |
For any future viewers of this issue, VS2017 completely changes the way TypeScript is handled. If you open task manager on Windows and watch your list of processes when you load a TypeScript project in VS2017, you'll notice that 3 node.js processes start up, these appear to run compilation and error checking/auto-complete services for VS2017 the say way VS Code handles TypeScript language services. The memory leak I was experiencing with TypeScript projects in VS2015 does not appear to occur when using node.js and tsserver.js for language services so I guess the solution is to upgrade to VS2017 (which, unfortunately, often isn't an option in corporate settings)... |
TypeScript Version: 2.3.3 (VS plugin)
Environment: Visual Studio 2015 update 3, Windows 7
Project Type: tsconfig.json (relevant part...)
Project Info TFS for SCM, mixed code project (TS and C#)
tsc --diagnostics -w:
171k lines, 580 files, ~800 MB mem used, ~8 sec Check time
Visual Studio runs out of memory and crashes frequently. The behavior varies and falls into one of these cases:
The issue has grown worse over the last ~6 months as our team has progressively upgraded from TypeScript 2.0 - 2.3 and as our codebase has grown. This week VS2015 has been crashes every 45 - 60 mins while editing TS files. I've been monitoring
devenv.exe
via Task Manager and the crashes always occur when it reaches ~3.2 GBs of memory usage.These crashes can be reproduced my me and a coworker with the proprietary codebase we work on (I also work on several small open source TypeScript projects and have not had VS2015 issues with those). I don't think I can condense the issue down to a non-proprietary repo that I'd be allowed to share with you guys so I'd love some guidance on debugging this from my end.
I have logs from running VS with logging enabled via
devenv.exe /log path
and would be happy to provide those logs if requested.I attempted to follow the Dev Mode in Visual Studio wiki article several weeks ago, but couldn't get it working and found issue #14928 which indicates that dev mode no longer works.
Also tried VS Code a few weeks ago and tsserver does not have the same memory issue as VS2015, but VS Code doesn't have all the features I've grown to love in VS2015 so I'd like to stick with VS2015 and get this issue figure out.
I looked around this repository and couldn't find anything that looked like the code for the VS plugin. I'd love if we could revisit this thought #2656 (comment).
I'm ready to devote my own time to resolving this issue as it's seriously affecting my productivity! Any suggestions on what I can do for you guys to help track down this issue?
The text was updated successfully, but these errors were encountered: