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) Slider Memory Leak -Increasing DOM Nodes #31

Open
WINOFFRG opened this issue May 8, 2023 · 0 comments
Open

(bug) Slider Memory Leak -Increasing DOM Nodes #31

WINOFFRG opened this issue May 8, 2023 · 0 comments
Assignees
Labels

Comments

@WINOFFRG
Copy link
Owner

WINOFFRG commented May 8, 2023

The Slider has been inspired from Radix UI. While dragging we see a an increase in DOM Nodes in Chrome Performance Tools.

chrome_hSCbEEtcQQ

msedge_w6u5bxFeTe

chrome_FJpfQquvy1

React can handle this well, No issues at all. However, what makes it different from https://601857eb614bae0021c9b9dd-cdntpgquse.chromatic.com/?path=/story/components-slider--styled Radix UI Slider where DOM Nodes aren't increasing? The similar case is observed in Timeline Slider where DOM Nodes starts increasing on hover event.

A way to debug this is to find the reference of Detached Elements, Other Similar Issues:

facebook/react#25772
facebook/react#23214

By using Detached Elements tool in Edge, It failed! Refer Image 2, References weren't found https://learn.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/memory-problems/dom-leaks Seems like the nodes were cleaned up too early even before profier could even read it.

Slider Code: https://github.com/WINOFFRG/limeplay/blob/985d2539ad64b99b59c3f406836e66c17a224acb/packages/limeplay-core/src/components/VolumeSlider/Slider.tsx
Radix Slider: https://github.com/radix-ui/primitives/blob/main/packages/react/slider/src/Slider.tsx

@WINOFFRG WINOFFRG added the bug Something isn't working label May 8, 2023
@WINOFFRG WINOFFRG self-assigned this May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant