IT

Visual Studio 2017-Node.JS 서버 프로세스-해제 하시겠습니까?

lottoking 2020. 7. 5. 07:47
반응형

Visual Studio 2017-Node.JS 서버 프로세스-해제 하시겠습니까?


Visual Studio 2017에서 ASP.NET 앱을 작업 중이며 1.3GB에서 1.8GB의 메모리에서 실행되는 Node.JS : Server-side Javascript 프로세스에 주목하고 있습니다. 내 IIS 작업자 프로세스는 VS 2015의 정상적인 크기입니다.

내 앱에는 Node.JS 라이브러리가 포함되어 있지 않습니다. 이 Node.JS : 서버 측 Javascript 프로세스를 끄는 방법을 알 수 없습니다. 내가 쓸모없는 것을 위해 너무 많은 기억을 먹고 있습니다.

VS 2017을 제거하고 VS 2015로 다시 전환하는 것을 제외하고 이것을 없애는 방법이 있습니까?

여기에 이미지 설명을 입력하십시오

작업 관리자에서 기본 프로세스를 종료해도 VS의 아무것도 영향을 미치지 않지만 세부 정보 탭으로 이동하여 개별 실행중인 프로세스를 종료하면 Visual Studio가 충돌합니다. 프로세스를 종료하고 로컬 웹 페이지를 실행 한 후 발생한 일에 대한 비디오를 가져 왔습니다 (품질이 좋지 않아 이미지 크기가 2MB로 제한되었습니다).

여기에 이미지 설명을 입력하십시오


도구> 옵션> 텍스트 편집기> JavaScript / TypeScript> 언어 서비스 ...

'새 JavaScript 언어 서비스 사용'을 선택 취소하십시오.

이는 NodeJS 프로세스가 시작되지 못하게하는 것으로 보입니다.


이 문제에 대한 피드백을 받았습니다.

https://developercommunity.visualstudio.com/content/problem/31406/visual-studio-2017-nodejs-server-process-turn-off.html

MS 팀으로부터 답변을 받았습니다. 그는이 게시물로 나를 안내했습니다.

https://developercommunity.visualstudio.com/content/problem/27033/nodejs-server-side-javascript-process- consumer-to.html? childToView = 27629 # comment-27629

node.exe 프로세스에는 다음 명령 줄이 있습니다. 여기에 이미지 설명을 입력하십시오

효과적으로 나는 들었다 :

VS 2017에서는 JavaScript로 여러 기능이 구현되었습니다. Node.js는 Visual Studio에서 해당 JavaScript를 실행하는 데 사용됩니다. 무엇보다도 Node는 사용자가 TypeScript 또는 JavaScript를 편집 할 때 형식화 및 인텔리전스 서비스를 제공하는 코드를 실행하는 데 사용됩니다. 이것은 VS 2015에서 변경된 것입니다.

내 질문에 대답하지만 다른 것을 밝힙니다 .JavaScript 파일에 지능을 부여하기 위해 1.4GB의 메모리가 필요한 이유는 무엇입니까? 또는 VS에 내장 된 솔루션 중 하나이므로 적은 메모리를 사용하므로 메모리가 부족합니다. 32 비트 프로세스의 2GB (4GB) 제한에 도달하지 않습니까? 질문 질문 질문.


Visual Studio에서 TypeScript 지원을 비활성화해야합니다.

도구> 확장 및 업데이트> Microsoft Visual Studio 용 TypeScript> 비활성화

그런 다음 Visual Studio를 다시 시작하면됩니다.


Ryan Ternier의 대답은 내가 옳은 방향이라고 믿는 것을 지적했습니다. 그의 링크 ( https://developercommunity.visualstudio.com/content/problem/27033/nodejs-server-side-javascript-process- consumer-to.html? childToView = 27629 # comment-27629)를 따라 Bowden Kelly의 답변으로 연결되었습니다. 허용 된 답변 바로 아래에 있습니다.

Bowden Kelly의 답변은 다음과 같습니다.

보고있는 노드 프로세스가 JavaScript 언어 서비스를 강화하고 있습니다. JS 파일, TS 파일 또는 JS / TS가 포함 된 파일 (html, cshtml 등)을 편집 할 때마다이 프로세스가 나타납니다. 이 프로세스는 IntelliSense, 코드 탐색, 서식 및 기타 편집 기능을 강화하는 것이며 프로젝트의 전체 컨텍스트를 분석하여이를 수행합니다. 프로젝트에 많은 .js 파일이 있으면 크기가 커질 수 있지만 분석 할 라이브러리 파일이 많을 가능성이 높습니다. 기본적으로 프로젝트의 모든 .js / .ts 파일을 스캔합니다. 그러나이 동작을 무시하고 언어 서비스를 조정하여 코드에만 집중할 수 있습니다. 이렇게하려면 다음 설정으로 프로젝트 루트에 tsconfig.json을 작성하십시오.

    {
    "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
        ]
    }
}

Once I added the folder with all my script libraries into the tsconfig.json file, life was good again.


The dirtiest workaround ever: just rename the ServiceHub.Host.Node.x86.exe to something else. Hasn't bothered me since. When (if) you actually need it, just rename it back.

Same trick works in Adobe Photoshop which also runs Node for some reason I haven't discovered in my usual workflow yet.


Turns out...

You can't just rename it and expect things to keep working. Who knew!

Apparently this renaming trick only works if you suspend VS process and kill Node, then resume VS. If you try to launch VS with Node exe file renamed, it will crash when opening a project with an "unknown hard error". Also, while working on an already loaded project, the lazy reference counter above methods and properties won't work because apparently that relies on Node being there somehow.

So it might be okay to just suspend the Node process and let Windows paging swap its memory out from ram onto the hard drive, without renaming the exe so you could start the VS again later without going through the renaming hassle. If you're willing to live with the consequences, that is.


Something that can help the projects mitigate the nodejs weight: is to reassign the node version used under Tools > Options > Projects and Solutions > Web Package Management to an installed 64bit version. Studio will still launch its internal Node for a tsserver.js instance, but any typescript in project will default to the supplied version -- and this helped me firsthand.

Also, another time I found the language service to be running down, I discovered using a simple tsconfig.json above the directories used as repositories, and specify to skipLibCheck: true, and add node_modules to exclude -- tremendously helped along the service, and one file does all folders beneath it, regardless of direct project references. P.S. -- if you do want JavaScript intellisense support still, make sure to set the allowJs: true and noEmit: true option.

Lastly, verify in the Typescript Options under the Tools > Options > Text Editor > Javascript/Typescript > Project that it is not checked to Automatically compile Typescript files which are not part of a project since that can also tie up resources for auxillary 3rd party projects using node or typescript.

이것들은 바보가 아닙니다. 각각의 정확한 병목 현상을 찾아야하지만, 나는 이것들이 나와 내 팀을 위해 더 자주 일한 것을 발견했습니다.


높은 메모리 소비량은 2017 년 5 월 10 일-Visual Studio 2017 버전 15.2 (26430.04) 릴리스에서 해결되었습니다.

여기에서 릴리스 정보 : https://www.visualstudio.com/en-us/news/releasenotes/vs2017-relnotes

여기 수정에 대한 특정 참고 사항 : https://developercommunity.visualstudio.com/content/problem/27033/nodejs-server-side-javascript-process- consumer-to.html

참고 URL : https://stackoverflow.com/questions/42769106/visual-studio-2017-node-js-server-process-turn-off

반응형