Skip to content

fix: memory leak in signature help - #336020

Merged
Dmitriy Vasyura (dmitrivMS) merged 2 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-extHostSignatureHelp-cancellation
Sep 18, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 2 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-extHostSignatureHelp-cancellation

Conversation

@SimonSiefke

Copy link
Copy Markdown
Contributor

Details

When signature help is canceled while an extension is still computing its result, the adapter caches the late result. The request has already ended, so that cache entry is never released.

Change

Check cancellation after the provider finishes and return before creating a cache entry.

Before

When requesting and canceling signature help 37 times, the cache grows by 37 signature-help results:

signature-before

After

No more signature-help cache growth is detected in the same 37-cycle test.

Test Video

signature-video.webm

Copilot AI balanced review requested due to automatic review settings September 13, 2026 08:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Note

This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.

@dmitrivMS

Copy link
Copy Markdown
Collaborator

Simon Siefke (@SimonSiefke) Thank you!

@dmitrivMS Dmitriy Vasyura (dmitrivMS) added this to the 1.139.0 milestone Sep 18, 2026
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit 7828363 into microsoft:main Sep 18, 2026
33 checks passed
@SimonSiefke
Simon Siefke (SimonSiefke) deleted the fix/memory-leak-extHostSignatureHelp-cancellation branch September 20, 2026 07:39
Abdon Morales (abdonmorales) pushed a commit to abdonmorales/vscode-utcs that referenced this pull request Sep 23, 2026
Fix signature help cache leak after cancellation

(cherry picked from commit 7828363)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants