memory leak, DOM nodes
See original GitHub issuehttps://codepen.io/wyzix33/pen/aeaMJx
Your Environment
-
flatpickr version used:4.6.2
-
Browser name and version: Chrome Version 76.0.3809.100 (Official Build) (64-bit)
-
OS and version: Windows 10
I’m detecting a Memory leak when creating and destroying flatpickr, Please test with that pen, just press add
, click the input to see the calendar and click remove
to destroy it, repeat …
This is what i’m getting:
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Debug DOM memory leaks with the Detached Elements tool
A memory leak can occur in your application when an element is no longer attached to the Document Object Model (DOM) tree, ...
Read more >Debug memory leaks with the Microsoft Edge Detached ...
A DOM memory leak occurs when an application keeps references to more and more of these detached elements, without actually reusing them ...
Read more >Causes of Memory Leaks in JavaScript and How to Avoid Them
Common Sources of Memory Leaks in JavaScript Code # · 1. Accidental global variables · 2. Closures · 3. Timers · 4. Event...
Read more >Get detached DOM elements to investigate memory leaks
Memory leaks can quickly become a big problem for long-running applications, and a common source of memory leaks is detached DOM elements ......
Read more >How can Detached DOM elements cause memory leak in ...
Detached DOM elements are the elements which have been removed from the DOM but their memory is still retained because of JavaScript.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey guys,
This seems to have become an issue again recently. It’s happened before and is definitely solvable. I’ll investigate what’s causing the leak and push out a fix.
Will keep you all posted 😃
+1 flatpickr version used:4.6.2 Chrome Version 76.0.3809.100 (Official Build) (64-bit) MacOS Mojave v10.14.6 (18G87)
I try to destroy flatpickr instance to reuse the input (last version 4.6.2) but this seem always exist in the DOM. and this create some conflicts for the init date also in the library : first initialization work fine but the next is wrong, on the second for example, init nodes is equal to
If I “console.log(self)” at the end of destroy() function, self is always with a flatpickr instance and input freshly set with a new flatpickr instance have a good value first and if click on the input, this set a default now() value.
I create my instances with this:
I can detroy() with this but if I reuse an input, normally flatpickr do the same in background, If I use this function in addition, in my console I destroy 2 times the instances but this seem to be nothing effective