Perf: Implement LRU node eviction in AsyncDataTree to prevent OOM - #332421
Open
Ayush Gupta (Ayush-kathil) wants to merge 4 commits into
Open
Perf: Implement LRU node eviction in AsyncDataTree to prevent OOM#332421Ayush Gupta (Ayush-kathil) wants to merge 4 commits into
Ayush Gupta (Ayush-kathil) wants to merge 4 commits into
Conversation
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Benjamin Christopher Simmonds (@benibenj)Matched files:
|
Author
|
@microsoft-github-policy-service agree |
Author
|
Hi Benjamin Christopher Simmonds (@benibenj) , Kindly Look into this PR if you need further any changes please let me know |
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
Fixes #332420
Description
What this PR does:
This PR addresses OOM (Out Of Memory) crashes in the Renderer when dealing with massive workspaces by capping the memory footprint of the
AsyncDataTree.When opening massive workspaces (e.g., mono-repos with 500k+ files) or returning massive search results, expanding the Explorer tree causes the
AsyncDataTreeto materialize hundreds of thousands of nodes in memory. Even though the DOM is virtualized vialistWidget.ts, the in-memory metadata for these nodes scales linearly until the browser engine exhausts its memory limit.Architectural Changes:
src/vs/base/browser/ui/tree/asyncDataTree.ts._onDidChangeCollapseStateto track node access history.performGarbageCollection).MAX_RETAINED_NODES(default 50k), the tree automatically collapses and evicts the least recently rendered nodes outside of the current viewport.Verification Steps