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

[Bug] Memory usage increases linearly when adding/removing monaco embedded in same-origin iframes in Chrome #4843

Open
2 tasks done
awphi opened this issue Feb 27, 2025 · 0 comments

Comments

@awphi
Copy link

awphi commented Feb 27, 2025

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

No response

Monaco Editor Playground Code

External repro here: https://github.com/awphi/monaco-chrome-iframe-issue/

Reproduction Steps

  • Clone this repo
  • pnpm install && pnpm dev (or whatever package manager)
  • Open the app in Chrome
  • Open the Performance Monitor in DevTools
  • Repeatedly press the add/remove iframe button
  • Observe memory usage and retained document/document frame count increase
Screen.Recording.2025-02-27.at.15.53.20.mov

Actual (Problematic) Behavior

Memory usage increases linearly with number of total iframes created in the page's lifespan.

Expected Behavior

Documents using monaco are not retained after its containing iframe is removed, preventing significant memory retention.

Additional Context

Browser Versions: Version 133.0.6943.142 (Official Build) (arm64), Version 135.0.7039.1 (Official Build) canary-dcheck (arm64)
OS: MacOS 15.3.1 (24D70)

Interestingly, reducing the text length in the model (e.g. change the dummy HTML in the above repro to abc) seems to circumvent this issue.

Also doesn't seem to affect FF 135.0.1 afaict

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant