Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak related to editor #218077

Closed
SimonSiefke opened this issue Jun 25, 2024 · 3 comments
Closed

Memory leak related to editor #218077

SimonSiefke opened this issue Jun 25, 2024 · 3 comments
Assignees
Labels
freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues

Comments

@SimonSiefke
Copy link
Contributor

SimonSiefke commented Jun 25, 2024

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.90.2
  • OS Version: Ubuntu 24.04

Steps to Reproduce

  1. Create a file "a.txt" with contents "a"
  2. Create a file "b.txt" with contents "b"
  3. Open file "a.txt", then open file "b.txt"
  4. Repeat switching tabs several times
  5. Notice that the number of detached Canvas elements increases by 3 each time

Test script

git clone [email protected]:SimonSiefke/vscode-memory-leak-finder.git &&
cd vscode-memory-leak-finder &&
git checkout v5.49.0 &&
npm ci &&
node packages/cli/bin/test.js --cwd packages/e2e --only  editor.switch-between-tabs --check-leaks --measure-after --measure canvas-count --runs 17 &&
cat .vscode-memory-leak-finder-results/canvas-count/editor.switch-between-tabs.json 

Test results

The number of canvas elements increases each time, indicating a memory leak:

canvas-count

Additional information

  • The memory leak seems not related to event listeners. The number of event listeners doesn't seem to increase during the tests.

  • Something seems to be holding on to disposed monaco editors, each monaco editor containing 3 canvas elements.

@TylerLeonhardt
Copy link
Member

@bpasero assigned you from an editor/tabs perspective? Maybe you have an idea

@bpasero bpasero assigned hediet and unassigned bpasero Jun 26, 2024
@bpasero bpasero added the freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues label Jun 26, 2024
@bpasero
Copy link
Member

bpasero commented Jun 26, 2024

Sounds to me like it could be Minimap.

@SimonSiefke
Copy link
Contributor Author

I tested again with VSCode 1.92.1 and found no more memory leaks related to canvas.

v1.90.2
canvas-count


v1.91.2:
canvas-count-new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues
Projects
None yet
Development

No branches or pull requests

6 participants