Node.js server-side JavaScript process consuming too much memory

After the installation of Visual Studio 2017 latest edition, I have been watching memory consumption.  Node.exe seems to be consistently around 500-700mb of RAM!.  I did find this post which helps explain what is going on.

“The node process you are seeing is powering the JavaScript language service. You will see this process appear anytime you edit a JS file, TS file, or any file with JS/TS inside (html, cshtml, etc). This process is what powers IntelliSense, code navigation, formatting, and other editing features and it does this by analyzing the entire context of your project. If you have a lot of .js files in your project, this can get large, but more than likely the issue is that you have a lot of library files that are being analyzed. By default, we will scan every .js/.ts file in your project. But you can override this behavior and tune the language service to only focus on your code. To do this create a tsconfig.json in your project root with the following settings:”

{
"compilerOptions": {
"allowJs": true,
"noEmit": true
},
"exclude": [
"wwwroot/lib" //ignore everything in the lib folder (bootstrap, jquery, etc) // add any other folders with library code here
],
"typeAcquisition": {
"enable": true,
"include": [
"bootstrap"
"jquery" //list libraries you are using here
]
}
}

Another option…

“Disabling the TypeScript extension is a work around for the moment, at least for me. Click Tools, Extensions and Updates, search for "TypeScript" and disable it. Restart Visual Studio.”

Give it a try and let me know how it goes….

 

Reference: https://developercommunity.visualstudio.com/content/problem/27033/nodejs-server-side-javascript-process-consuming-to.html

js

Author

david

comments powered by Disqus