Skip to content

fix: memory leak in issueReporterOverlay - #335102

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

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

Conversation

@SimonSiefke

Copy link
Copy Markdown
Contributor

Details

Saving or discarding an annotation editor left the closed editor and its event subscriptions in the issue reporter's disposable store. Rebuilding screenshot thumbnails also left the previous thumbnails' listeners in that store.

Change

Give each annotation editor a disposable store and remove it on save or discard. Clear thumbnail listeners whenever the thumbnails are rebuilt.

Before

After 37 screenshot annotation reopening cycles, 74 closed annotation editors and 148 DOM listener objects remained, along with their callbacks.

before-annotation

After

No more annotation-editor or thumbnail-listener growth is detected by named-function-count3 over the same 37 cycles.

Test Video

Seven screenshot annotation reopening cycles were recorded and completed successfully.

annotation-test.webm

Copilot AI balanced review requested due to automatic review settings September 8, 2026 16:43

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 focused cleanup changes are correct and covered by relevant regression tests.

Pull request overview

Fixes disposable retention in the issue reporter’s screenshot annotation workflow.

Changes:

  • Adds scoped stores for annotation editors and thumbnail listeners.
  • Disposes obsolete listeners when thumbnails rebuild.
  • Adds regression tests for editor and listener cleanup.
File summaries
File Description
issueReporterOverlay.ts Implements scoped lifecycle cleanup.
issueReporterOverlay.test.ts Tests disposal and listener removal.
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) added this to the 1.139.0 milestone Sep 18, 2026
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit 7569151 into microsoft:main Sep 18, 2026
33 of 34 checks passed
@SimonSiefke
Simon Siefke (SimonSiefke) deleted the fix/memory-leak-issueReporterOverlay branch September 20, 2026 07:39
Abdon Morales (abdonmorales) pushed a commit to abdonmorales/vscode-utcs that referenced this pull request Sep 23, 2026
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