Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

fix(datepicker): memory leak fix for datepicker. #2684

Closed
wants to merge 1 commit into from
Closed

fix(datepicker): memory leak fix for datepicker. #2684

wants to merge 1 commit into from

Conversation

ankit5990
Copy link
Contributor

fix for issue #2658
Datepicker causes massive memory leaks when used with jquery.
Calling remove on the popupElement that is created by the directive fixes the issue.
Plunkers for comparison of memory before and after the fix added in the issue.

@chrisirhc
Copy link
Contributor

Interesting find. It looks harmless to do this but I'm curious as to why it fixes the leaks. Thanks @ankit5990 , will look into this very soon.

@chrisirhc
Copy link
Contributor

This might have to do with jQuery's cache. Doing .remove might explicitly remove it from the caching. It also makes sense to set it to null as well as datepickerEl for easier GC. I'll try that and see how the memory performance goes.

@ankit5990
Copy link
Contributor Author

I did try making it null as well. Though yes it would help it in an easier GC theoretically, but i did not see any change in memory usage after that. So I just made a minimal fix.

@chrisirhc chrisirhc closed this in 08c150e Sep 15, 2014
@chrisirhc
Copy link
Contributor

Tested, verified, and merged. Thank you for your excellent find and contribution, @ankit5990 .

@ankit5990
Copy link
Contributor Author

happy to contribute :)
thanks for accepting the patch

ulle pushed a commit to ulle/bootstrap that referenced this pull request Oct 22, 2014
OronNadiv pushed a commit to lanetix/bootstrap that referenced this pull request Nov 18, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants