Skip to content

fix: memory leak in extension host speech - #336021

Merged
Dmitriy Vasyura (dmitrivMS) merged 1 commit into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-extHostSpeech-lateSession
Sep 18, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 1 commit into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-extHostSpeech-lateSession

Conversation

@SimonSiefke

Copy link
Copy Markdown
Contributor

Details

If Read Aloud is stopped while a speech provider is still creating its session, cancellation removes the session from the extension host. When the provider finishes, the session is added back to the synthesizer map with no later cancellation to remove it.

Change

Check cancellation after the provider finishes, before storing the synthesizer or subscribing to its events.

Before

When starting and immediately stopping Read Aloud 37 times with a delayed speech provider, 37 extra speech sessions remain in the extension host:

before

After

No more canceled speech session growth is detected.

Test Video

video.webm

Copilot AI balanced review requested due to automatic review settings September 13, 2026 09:05

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) merged commit c8103ae into microsoft:main Sep 18, 2026
33 checks passed
@SimonSiefke
Simon Siefke (SimonSiefke) deleted the fix/memory-leak-extHostSpeech-lateSession branch September 20, 2026 07:39
Abdon Morales (abdonmorales) pushed a commit to abdonmorales/vscode-utcs that referenced this pull request Sep 23, 2026
@dboline8-del

Copy link
Copy Markdown

SimonSiefke:fix/memory-leak-extHostSpeech-lateSession

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