Repository navigation
fix: memory leak in auxiliary window font measurements - #338255
Merged
Dmitriy Vasyura (dmitrivMS) merged 3 commits intoSep 28, 2026
Merged
Dmitriy Vasyura (dmitrivMS) merged 3 commits into
Dmitriy Vasyura (dmitrivMS) merged 3 commits into
Conversation
Copilot started reviewing on behalf of
Simon Siefke (SimonSiefke)
September 27, 2026 19:41
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The delayed-eviction test recreates the cache itself and therefore does not verify the key regression.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Fixes auxiliary-window font measurement caches remaining after window closure.
Changes:
- Removes caches when windows unregister.
- Prevents delayed eviction from recreating removed caches.
- Adds lifecycle and garbage-collection tests.
| File | Description |
|---|---|
src/vs/editor/browser/config/fontMeasurements.ts |
Cleans up per-window caches. |
src/vs/editor/test/browser/config/fontMeasurements.test.ts |
Adds auxiliary-window cleanup tests. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Dmitriy Vasyura (dmitrivMS)
enabled auto-merge (squash)
September 28, 2026 07:21
Collaborator
|
Simon Siefke (@SimonSiefke) Thank you! |
Dmitriy Vasyura (dmitrivMS)
approved these changes
Sep 28, 2026
Nick Trogh (ntrogh)
approved these changes
Sep 28, 2026
Christof Marti (chrmarti)
approved these changes
Sep 28, 2026
Simon Siefke (SimonSiefke)
deleted the
fix/memory-leak-fontMeasurements-windowDisposal
branch
September 29, 2026 11:15
Abdon Morales (abdonmorales)
pushed a commit
to abdonmorales/vscode-utcs
that referenced
this pull request
Oct 1, 2026
) * fix: memory leak in auxiliary window font measurements * test: inspect closed-window font caches without allocating (cherry picked from commit 9d4555e)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Details
Each auxiliary editor window gets its own font-measurement cache. Closing the window leaves that cache and its font readings in the renderer’s global cache map.
Change
Delete the closed window’s cache when the window unregisters. Delayed eviction uses an existing cache instead of recreating one after the window closes.
Before
Moving a text editor to a new window and closing it 37 times grows the font cache map from 3 to 40 entries, adding 37 FontMeasurementsCache, FontInfo, and BareFontInfo objects.
After
The font cache map stays at one entry for the live main window. All three font-growth rows disappear; 11 unrelated growth rows remain.
Test Video
test.mp4
AI disclosure: Model: GPT-6-Astra (investigation and implementation), GPT-6 (PR preparation). Worktime: approximately 37 min