Skip to content

Conversation

@SimonSiefke
Copy link
Contributor

This fixes a memory leak related to edit context.

When opening and closing a text editor, the number of EditContexts seems to increase each time. Setting the editContext property to undefined in the dispose function seems to solve this issue.

Test Script

git clone git@github.com:SimonSiefke/vscode-memory-leak-finder.git &&
cd vscode-memory-leak-finder &&
git checkout v5.88.0 &&
npm ci &&
node packages/cli/bin/test.js --cwd packages/e2e  --check-leaks --measure-after --measure edit-context-count --only ^editor.open --runs 97 &&
cat ./.vscode-memory-leak-finder-results/edit-context-count/editor.open.json 

Before

The number of edit contexts when opening and closing a text editor 97 times grows from 2 to 99:

before

After

The number of edit contexts when opening and closing a text editor 97 times stays constant:

after

@aiday-mar aiday-mar enabled auto-merge (squash) July 21, 2025 09:07
@vs-code-engineering vs-code-engineering bot added this to the July 2025 milestone Jul 21, 2025
@aiday-mar aiday-mar merged commit c3d67c3 into microsoft:main Jul 21, 2025
17 checks passed
@ivanstepanovftw
Copy link

Hello! Please, review and merge #154465

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

5 participants