PowerShell / PowerShell/PowerShellEditorServices
Unreasonably enormous memory usage with Kate on Windows since 3.8
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 767
- Forks
- 266
- Ø Merge
- 3 T. 16 Std.
- Gemergte PRs (30 T.)
- 1
Beschreibung
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:
- Install Kate 23.08 on x64 Windows, using traditional installation.
- Unpack PowerShellEditorServices somewhere convenient.
- 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
- Enable Kate's LSP client: Toggle on Settings > Configure Kate > Plugins > LSP Client, then apply.
- 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$"
}
}
}
- Open Task Manager and watch the memory usage of the
pwshprocess Kate spawns as you browse around a large PowerShell project. Make sure you have a build of the project on$PSModulePathso 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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere das Speicherwachstum mit Kate, PowerShellEditorServices, Start-EditorServices.ps1 und PowerShellLanguageServer.ps1, während du in einem großen Projekt navigierst. Vergleiche Version 3.7.3 mit 3.8.7 und späteren Versionen und verfolge anschließend das durch LSP gesteuerte Prozessverhalten; abgeschlossen ist die Aufgabe, wenn die Regression identifiziert und behoben wurde, sodass pwsh einen angemessenen Speicherverbrauch beibehält.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- powershell
- Bereich
- devtools, performance
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100