PowerShell / vscode-powershell

Provides PowerShell language and debugging support for Visual Studio Code
https://marketplace.visualstudio.com/items/ms-vscode.PowerShell
MIT License
1.69k stars 487 forks source link

Massive RAM consumption on macbook M1 #4496

Closed BorysMariusz closed 1 year ago

BorysMariusz commented 1 year ago

Prerequisites

Summary

I am working on Macbook M1 with VScode and PowerShell Core. When the Vscode is opening the Integrated Terminal with pwsh is being opened. And from the beginning it consumes 5 GB of RAM. When I am running some PowerShell scripts it increased more, the highest usage was 14 GB. MacOS, vscode and PowerShell extension are up to date.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.3.3
PSEdition                      Core
GitCommitId                    7.3.3
OS                             Darwin 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar  6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

Version: 1.77.0 (Universal)
Commit: 7f329fe6c66b0f86ae1574c2911b681ad5a45d63
Date: 2023-03-29T09:57:11.797Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Darwin arm64 22.4.0
Sandboxed: No

Extension Version

PowerShell Extension Release History
v2023.3.3
Thursday, March 30, 2023

Steps to Reproduce

Open pwsh integrated terminal in vscode

Visuals

No response

Logs

No response

andyleejordan commented 1 year ago

How large is your project, i.e. how many PowerShell files (and LOC)? Does the RAM usage decrease if you enable the setting powershell.analyzeOpenDocumentsOnly?

BorysMariusz commented 1 year ago

Hello The way I use vscode is opening folder with bunch of files from gitrepo and or the scripts. I will check the setting you have mentioned.

image image

Best regards and thank you for feedback

Mariusz

BorysMariusz commented 1 year ago

I am making the test right now. I am running script to search some resources in Azure from my local laptop via vscode. pwsh service is mac 542 MB .... :) I will test more this week but it seems it is working. Thank you @andschwa

andyleejordan commented 1 year ago

Fantastic! We added that setting in order to strike the balance between the default of analyzing a whole projects' files (so that the problems pane populates for the project, and this works fine for most repos) and a sensible restricted mode where you still get analysis but only on-demand (for repos like yours where there's just too many files).

ghost commented 1 year ago

This issue has been marked as answered and has not had any activity in a day. It has been automatically closed for housekeeping purposes.