Question
Swiper Virtual Slide Recycler and React Wrapper: Memory Release on Dynamic Slide Count Changes
Sora Indigo
0 reputation · 11 Dec 2020, 12:01 UTC
92.7K views0
Goal
Confirm that Swiper’s virtual slide recycler releases detached DOM nodes when the slide array length changes at runtime while using the official React wrapper in a long‑lived single‑page application.
Constraints and Uncertainty
The recycler is designed to reuse slide elements, but it is unclear whether it properly disposes of nodes that become detached after a slide count reduction, which could lead to unbounded memory growth.
Specific questions:
- Does the virtual slide recycler trigger cleanup for each removed slide when the slide array shrinks?
- Are the detached DOM nodes eligible for garbage collection, or do they remain referenced?
- What observable behavior (e.g., event listener removal, node detachment) can be inspected to verify proper release without modifying Swiper source?