PowerShell / PowerShell/PowerShellEditorServices

Unreasonably enormous memory usage with Kate on Windows since 3.8

オープン
#2,063 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C#
スター
767
フォーク
266
平均マージ
3日 16時間
マージ済み PR(30日)
1

説明

Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.
Steps to reproduce

I don't know what exactly triggers this and narrowing it down isn't easy, but here's some possible steps:

  1. Install Kate 23.08 on x64 Windows, using traditional installation.
  2. Unpack PowerShellEditorServices somewhere convenient.
  3. Create a PowerShell script like this:
mkdir -ErrorAction SilentlyContinue $env:TEMP/pses-qdls
& 'C:/PATH/TO/PSES/PowerShellEditorServices/Start-EditorServices.ps1' -BundledModulesPath C:/PATH/TO/PSES -LogPath $env:TEMP/pses-qdls/logs.log -SessionDetailsPath $env:TEMP/pses-qdls/session.json -FeatureFlags @() -AdditionalModules @() -HostName 'qdls' -HostProfileId 'qdls' -HostVersion 0.0.0 -Stdio -LogLevel Normal
  1. Enable Kate's LSP client: Toggle on Settings > Configure Kate > Plugins > LSP Client, then apply.
  2. Go to the Settings > Configure Kate > LSP Client > User Server Settings and add a block like this:
{
     "servers": {
          "powershell": {
              "command": ["pwsh", "-NoLogo", "-NoProfile", "-Command", "$PSStyle.OutputRendering = 'PlainText'; & C:/PATH/TO/PowerShellLanguageServer.ps1"],
              "highlightingModeRegex": "^PowerShell$"
          }
     }
}
  1. Open Task Manager and watch the memory usage of the pwsh process Kate spawns as you browse around a large PowerShell project. Make sure you have a build of the project on $PSModulePath so PSES sees its functions etc.
Expected behavior

Reasonable memory usage.

Actual behavior

Memory usage of multiple Gbytes after running for a few minutes.

Error details

No response

Environment data
PS$> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.6
PSEdition                      Core
GitCommitId                    7.3.6
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Version

3.10.0, 3.9.0, 3.8.7; 3.7.3 not affected

Visuals

No response

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

大規模なプロジェクトを閲覧しながら、Kate、PowerShellEditorServices、Start-EditorServices.ps1、PowerShellLanguageServer.ps1 を使用してメモリ増加を再現します。バージョン 3.7.3 と 3.8.7 以降を比較し、その後、LSP によって駆動されるプロセスの動作を追跡します。pwsh が妥当なメモリ使用量を維持できるように回帰を特定して修正できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
powershell
領域
devtools, performance
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。