Skip to content

fix: memory leak in notification action view items - #333340

Merged
Dmitriy Vasyura (dmitrivMS) merged 3 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-notification-action-view-item
Sep 18, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 3 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-notification-action-view-item

Conversation

@SimonSiefke

Copy link
Copy Markdown
Contributor

Details

When a notification is created, an action view item is added to the notification viewer. But that action item doesn't seem to be removed when the notification is closed or disposed.

Change

The action view item is no longer added to the notification row's lifetime store. ActionBar.clear() disposes it when the row is reused.

Before

When opening and clearing the Notification Center 37 times, 16 notification action, hover, and view callbacks each grow by 37:

before

After

No more notification action view item leak is detected.

Test Video

test-video.webm

Copilot AI balanced review requested due to automatic review settings August 29, 2026 15:17
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Benjamin Christopher Simmonds (@benibenj)

Matched files:

  • src/vs/workbench/browser/parts/notifications/notificationsViewer.ts

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.

Pull request overview

Fixes retained notification action view items by assigning disposal ownership to ActionBar.

Changes:

  • Stops retaining dropdown action items in the notification template store.
  • Adds regression coverage for row reuse.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
notificationsViewer.ts Lets ActionBar.clear() dispose replaced action items.
notificationsList.test.ts Tests stable disposable counts after replacement.

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

Comment thread src/vs/workbench/test/browser/notificationsList.test.ts
@dmitrivMS Dmitriy Vasyura (dmitrivMS) added freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues and removed triage-needed labels Sep 18, 2026
@dmitrivMS Dmitriy Vasyura (dmitrivMS) added this to the 1.139.0 milestone Sep 18, 2026
@dmitrivMS

Copy link
Copy Markdown
Collaborator

Simon Siefke (@SimonSiefke) Thank you!

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit 16c04af into microsoft:main Sep 18, 2026
33 checks passed
@SimonSiefke
Simon Siefke (SimonSiefke) deleted the fix/memory-leak-notification-action-view-item 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 notification action view item leak

* Move notification renderer test to dedicated suite

(cherry picked from commit 16c04af)
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