fix: memory leak in folder configuration#279230
Merged
sandy081 merged 5 commits intomicrosoft:mainfrom Jan 21, 2026
Merged
Conversation
sandy081
requested changes
Dec 9, 2025
src/vs/workbench/services/configuration/browser/configurationService.ts
Outdated
Show resolved
Hide resolved
sandy081
approved these changes
Jan 16, 2026
dmitrivMS
approved these changes
Jan 16, 2026
Contributor
Author
|
(updated branch to try to fix MacOS CI timeout) |
dmitrivMS
approved these changes
Jan 21, 2026
DonJayamanne
approved these changes
Jan 21, 2026
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.
Fixes some memory leaks in folder configuration / configuration service.
Issue one: Registering to global configuration service
Since there is only one global configuration service, registering a folder configuration to that class using
this._registermakes it so the class holds on to the folder configuration forever, since the global configuration service is never disposed.Fix
Registering all folder related disposables only to the map
cachedFolderConfigs: Map<URI, FolderConfiguration>Issue two: Resetting caches
This code resets the caches, but it doesn't dispose the values of the map.
Fix
Switching to a
DisposableMapand making use of it'sclearAndDisposeAllfunction.Before
When executing a task 97 times, the number of functions/objects related to
FolderConfigurationgrows each timeAfter
When executing a task 97 times, while the number of various functions/objects still grows, it seems there are no more leaks related to
FolderConfiguration