PowerShell / PowerShell/PowerShellEditorServices

Memory leak until the system freezes

Open
#2,171 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Script Analysis Issue-Enhancement Up for Grabs
Dominant language
C#
Stars
767
Forks
266
Avg merge
3d 16h
Merged PRs (30d)
1

Description

Prerequisites
  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with PowerShell Editor Services itself and does not reproduce in a standalone PowerShell instance, and is not an issue with my editor.
  • I have verified that I am using the latest version of PowerShell Editor Services.
  • If this is a security issue, I have read the security issue reporting guidance.
Summary

Every time the extension "PowerShell v2024.3.2 (pre-release)" is enabled, the memory usage goes up until the system freezes. When disabling the extension, there is no issue. Same issue with the release version "Powershell 2024.2.2".

Also reported here.

PowerShell Version
Name                           Value
----                           -----
PSVersion                      7.4.4
PSEdition                      Core
GitCommitId                    7.4.4
OS                             Microsoft Windows 10.0.20348
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Editor Version
vs code 1.92.1
eaa41d57266683296de7d118f574d0c2652e1fc4
x64

Name             : ConsoleHost
Version          : 7.4.4
InstanceId       : b1eb55a6-5f37-4759-bc50-59721354e6d5
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace
PowerShell Editor Services Version
The one built-in to "PowerShell v2024.3.2 (pre-release)" and "Powershell 2024.2.2".
Steps to Reproduce

Every time the extension "PowerShell v2024.3.2 (pre-release)" is enabled, the memory usage goes up until the system freezes. When disabling the extension, there is no issue. Same issue with the release version "Powershell 2024.2.2".

Simply enable the extension, open VS Code and wait for the RAM to be fully consumed. No coding required.

Visuals

Screenshot 2024-08-14 090503
Screenshot 2024-08-14 085556
Screenshot 2024-08-14 085522
Screenshot 2024-08-14 085436
Screenshot 2024-08-14 085401
Screenshot 2024-08-14 085357

Logs

1723619554-68a1cfd5-1a3e-43e5-9fc4-7e8fa8a133561723619552104.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the leak by enabling the PowerShell extension in VS Code and reviewing the attached logs; the issue also links to the troubleshooting guide and a related VS Code issue. Trace the extension's memory growth from the available PowerShell Editor Services entry points, then verify that memory no longer grows until the system freezes when the extension remains enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.