Skip to content

fix: memory leak in image carousel editor - #333981

Open
Simon Siefke (SimonSiefke) wants to merge 2 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-imageCarouselEditor
Open

fix: memory leak in image carousel editor#333981
Simon Siefke (SimonSiefke) wants to merge 2 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-imageCarouselEditor

Conversation

@SimonSiefke

@SimonSiefke Simon Siefke (SimonSiefke) commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Details

The image carousel loads an image and its thumbnail at the same time. Both requests could create a blob URL before either request populated the cache, so one URL was replaced without being revoked when the editor closed.

Change

Check the string cache again after the image data loads so concurrent requests reuse the first URL instead of creating another one.

Before

Across 37 runs, 114 object URLs were created, 75 released, and 39 remained unreleased (black: released, red: unreleased):
before

After

Across the same 37 runs, all 75 created object URLs were released and none remained unreleased:
after

Test Video

The seven-run Images Preview scenario completes with every object URL revoked:
test-video.webm

Copilot AI balanced review requested due to automatic review settings September 2, 2026 12:48

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.

🟡 Changes recommended

In-flight reads can still create leaked URLs after cache cleanup.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Prevents duplicate blob URLs during concurrent image loading.

Changes:

  • Rechecks the blob URL cache after loading.
  • Adds concurrency and revocation coverage.
File summaries
File Description
imageCarouselEditor.ts Reuses concurrently cached URLs.
imageCarouselEditor.test.ts Tests concurrent URL reuse and revocation.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants