Visitar URL original
fix: memory leak in notebook cell status bar commands by SimonSiefke · Pull Request #336028 · microsoft/vscode · GitHub
Skip to content

fix: memory leak in notebook cell status bar commands - #336028

Merged
Dmitriy Vasyura (dmitrivMS) merged 1 commit into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-notebookCellStatusBar-commands
Sep 29, 2026
Merged

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

Conversation

@SimonSiefke

Copy link
Copy Markdown
Contributor

Details

Notebook cell status-bar items can register commands with arguments. Releasing the items deletes their cache entry, but does not dispose the command store saved in that entry.

Change

Dispose the cached command store before deleting the status-bar cache entry.

Before

When refreshing notebook cell status-bar items 37 times, 37 old command arguments remain in the extension host:

notebook-status-before

After

No more released status-bar command arguments accumulate in the same 37-cycle test.

Test Video

notebook-status-desktop-video.webm

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

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.

🟢 Approval recommended

The targeted fix is correct and its lifecycle edge cases are adequately tested.

Pull request overview

Disposes notebook status-bar command resources when cached results are released, preventing extension-host memory leaks.

Changes:

  • Dispose cached command stores before deletion.
  • Add tests for cleanup, isolation, and repeated releases.
File summaries
File Description
extHostNotebook.ts Disposes status-bar cache entries.
extHostNotebookStatusCommands.test.ts Tests command-resource lifetimes.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@dmitrivMS

Copy link
Copy Markdown
Collaborator

Simon Siefke (@SimonSiefke) Thank you!

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit df0fb09 into microsoft:main Sep 29, 2026
33 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.141.0 milestone Sep 29, 2026
@SimonSiefke
Simon Siefke (SimonSiefke) deleted the fix/memory-leak-notebookCellStatusBar-commands branch September 29, 2026 11:15
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 notebook-statusbar

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants