Skip to content

Memory leak in sourcekit-lsp on Linux #84380

@37o1

Description

@37o1

Description

When editing the LSP consumes memory and never seems to free any previously allocated data. I attached a video showing this behavior. It only shows the LSP consuming up to 300MB, but I've repeatedly seen it consume multiple gigabytes on just a few hundred line projects.

I only noticed this bug after the LSP consumed all my RAM and crashed the system multiple times.


I'm not used to making bug reports, so I'm sorry if I missed some important information.

Reproduction

Installed Swift from https://www.swift.org/install/linux/ using the swiftly option

Installed the official Swift extensions for VSCode: https://marketplace.visualstudio.com/items?itemName=swiftlang.swift-vscode

Editing a any Swift file in VSCode caused the bug to happen

Expected behavior

Expected behavior: Properly freeing memory.

Environment

$ swift --version Swift version 6.0 (swift-6.0-RELEASE) Target: x86_64-unknown-linux-gnu $ uname -a Linux prometheus 6.14.0-29-generic #29-Ubuntu SMP PREEMPT_DYNAMIC Thu Aug 7 18:32:38 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux $ code --version 1.104.1 0f0d87fa9e96c856c5212fc86db137ac0d783365 x64 

Additional information

Screencast.From.2025-09-18.23-00-02.mp4

Metadata

Metadata

Assignees

Labels

SourceKitArea → source tooling: SourceKitbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.memory leakbug: Memory leak

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions