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

[Synthetic shadow] Memory leak when clicking on element #4885

Open
nolanlawson opened this issue Nov 18, 2024 · 1 comment
Open

[Synthetic shadow] Memory leak when clicking on element #4885

nolanlawson opened this issue Nov 18, 2024 · 1 comment
Labels
BUG P3 bug perf Synthetic Shadow Synthetic shadow DOM polyfill

Comments

@nolanlawson
Copy link
Collaborator

nolanlawson commented Nov 18, 2024

When using @lwc/synthetic-shadow, a component rendering a <h1> will leak if that <h1> is clicked. This does not repro if the <h1> is not clicked, and it does not repro if @lwc/synthetic-shadow is not being used.

Minimal repro

Repro steps:

  1. Clone the above commit
  2. pnpm i && pnpm run dev
  3. Open localhost:3000
  4. Click "Add"
  5. Click the "Hello world" <h1>
  6. Click "Remove"
  7. Take a Chrome Memory snapshot in the DevTools
  8. Notice that 10MB is being allocated and <x-app> is leaked

Screenshot 2024-11-18 at 12 20 48 PM

Screenshot 2024-11-18 at 1 03 50 PM

I can also reproduce this in Firefox.

@nolanlawson nolanlawson added bug Synthetic Shadow Synthetic shadow DOM polyfill perf BUG P3 labels Nov 18, 2024
Copy link

git2gus bot commented Nov 19, 2024

This issue has been linked to a new work item: W-17274024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG P3 bug perf Synthetic Shadow Synthetic shadow DOM polyfill
Projects
None yet
Development

No branches or pull requests

1 participant