0.1.7 High CPU usage and memory usage increasing (windows 10)
See original GitHub issueHi,
I’m using the latest 0.1.7 version in my angular project and notice slow vscode performance and Intellisense slowness or even not working. When I check the Windows Task Manager I see vscode consuming 50% to 60% CPU. The Angular Language Service OUTPUT window keeps logging the following two errors continuously:
Config file name: c:/Code/Git/xms/tsconfig.json
Angular Language Service: 5.0.0-beta.5
TypeScript: 2.4.2
Error for getTemplateRefrences:
Error: PopupComponent cannot be used as an entry component.
at syntaxError (C:\Users\Maarten\.vscode\extensions\Angular.ng-template-0.1.7\server\node_modules\@angular\language-service\bundles\language-service.umd.js:253:17)
at CompileMetadataResolver._getEntryComponentMetadata (C:\Users\Maarten\.vscode\extensions\Angular.ng-template-0.1.7\server\node_modules\@angular\language-service\bundles\language-service.umd.js:9258:19)
at C:\Users\Maarten\.vscode\extensions\Angular.ng-template-0.1.7\server\node_modules\@angular\language-service\bundles\language-service.umd.js:8915:53
at Array.map (native)
at CompileMetadataResolver.getNgModuleMetadata (C:\Users\Maarten\.vscode\extensions\Angular.ng-template-0.1.7\server\node_modules\@angular\language-service\bundles\language-service.umd.js:8915:18)
at CompileMetadataResolver.getNgModuleSummary (C:\Users\Maarten\.vscode\extensions\Angular.ng-template-0.1.7\server\node_modules\@angular\language-service\bundles\language-service.umd.js:8773:35)
at C:\Users\Maarten\.vscode\extensions\Angular.ng-template-0.1.7\server\node_modules\@angular\language-service\bundles\language-service.umd.js:8837:55
at Array.forEach (native)
at CompileMetadataResolver.getNgModuleMetadata (C:\Users\Maarten\.vscode\extensions\Angular.ng-template-0.1.7\server\node_modules\@angular\language-service\bundles\language-service.umd.js:8822:49)
at CompileMetadataResolver.getNgModuleSummary (C:\Users\Maarten\.vscode\extensions\Angular.ng-template-0.1.7\server\node_modules\@angular\language-service\bundles\language-service.umd.js:8773:35)
getTemplateRefrences: 5883ms
SERVER ERROR: Cannot read property 'length' of null
TypeError: Cannot read property 'length' of null
at Project.updateFileMap (C:\Users\Maarten\.vscode\extensions\Angular.ng-template-0.1.7\server\editorServices.js:797:94)
at Project.updateGraph (C:\Users\Maarten\.vscode\extensions\Angular.ng-template-0.1.7\server\editorServices.js:815:14)
at Project.finishGraph (C:\Users\Maarten\.vscode\extensions\Angular.ng-template-0.1.7\server\editorServices.js:807:14)
at ProjectService.openConfigFile (C:\Users\Maarten\.vscode\extensions\Angular.ng-template-0.1.7\server\editorServices.js:1634:17)
at ProjectService.openOrUpdateConfiguredProjectForFile (C:\Users\Maarten\.vscode\extensions\Angular.ng-template-0.1.7\server\editorServices.js:1486:41)
at ProjectService.openClientFile (C:\Users\Maarten\.vscode\extensions\Angular.ng-template-0.1.7\server\editorServices.js:1404:23)
at C:\Users\Maarten\.vscode\extensions\Angular.ng-template-0.1.7\server\documents.js:135:47
at TextDocuments.logErrors (C:\Users\Maarten\.vscode\extensions\Angular.ng-template-0.1.7\server\documents.js:235:13)
at C:\Users\Maarten\.vscode\extensions\Angular.ng-template-0.1.7\server\documents.js:131:74
at handleNotification (C:\Users\Maarten\.vscode\extensions\Angular.ng-template-0.1.7\server\node_modules\vscode-jsonrpc\lib\main.js:353:21)
[Error - 13:38:00] Notification handler 'textDocument/didOpen' failed with message: Cannot read property 'length' of null
Everytime when the errors are logged, the memory usage of vscode increases. Within a few minutes, my vscode instance consumes more than 2GB memory. When I disable the extension, the problem doesn’t occur.
My project uses the 4.4.2 version of the @angular/* packages. I updated my local “@angular/language-service” version to the mentioned “^5.0.0-beta.5” version and TypeScript to version “2.4.2”. No luck either. The errors keep occurring.
Any help is appreciated.
Kind regards,
Maarten
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:13 (3 by maintainers)
I understand that it is easy but given that I have 60+ bugs to look at in this repository as well as 100+ in angular/angular, it would help if I just had to clone a repository.
Almost every bug reported is simple for the reporter to reproduce and usually involves some simple steps that I can easily do myself but when I try to reproduce it I can’t because some critical step is missing which is obvious to the reporter but not to me. This is why we ask for a plunker in angular/angular and I ask for a repository here.
A repository that reproduces the issue avoids all the “oh I forgot to tell you, you also need to do x” issues. This allows the steps to be as simple as clone X, “npm install” start VS Code in the directory, try to do Y in file Z.
@chuckjaz this is still a big issue, I’ve uninstalled the plugin completely (tried 1.0.6 as well with no luck). you can find my repro repo here: https://github.com/cmeyertons/174_vscode_ng_language_service_repro
This is just a git pull of the Angular Tour of Heroes tutorial so it should be pretty standard (maybe i didn’t need a separate repo)
Steps to reproduce:
npm i
heroes.component.ts
and line 71this.selectedhero.id
.id
and save the file, retype.id
, hover and it will briefly (~1s) show a loading indicator. On larger projects this indicator can take from 5-10 s. w/o the extension, there is no loading indicator on hover.I did this on VS code 1.24.1 w/ all extensions disabled except Angular Language Service (0.1.9).