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

$uibTooltip creates massive memory leak #4604

Closed
maxklenk opened this issue Oct 13, 2015 · 12 comments
Closed

$uibTooltip creates massive memory leak #4604

maxklenk opened this issue Oct 13, 2015 · 12 comments

Comments

@maxklenk
Copy link

Each usage of <span uib-tooltip="Hey"></span> creates a memory leak on each state change with ui-router.

When profiling the heap allocation of this plnkr memory leaks can be seen with tooltips:
screen shot 2015-10-13 at 2 32 46 pm
and less when there are no tooltips
screen shot 2015-10-13 at 2 33 00 pm

@Foxandxss
Copy link
Contributor

@maxklenk Could you please check if that happens with the old non-prefixed version? And if possible with 0.13.4?

Thank you.

@maxklenk
Copy link
Author

Sure:

0.14.1 uib-tooltip => memory leak
0.14.1 tooltip => memory leak
0.14.0 uib-tooltip => memory leak
0.14.0 tooltip => memory leak
0.13.4 tooltip => no memory leak

@Foxandxss
Copy link
Contributor

Interesting, really interesting. I wonder if we introduced it with the prefix work. It is too much ask for 0.14.0 test?

@Foxandxss
Copy link
Contributor

We did lot of tooltip changes in 0.14.0 so one of them is.

Thoughts @wesleycho ?

@maxklenk
Copy link
Author

The memory leak was already introduces in the 0.14.0 release.

@Foxandxss
Copy link
Contributor

Thanks, it is time to check out why and fix it 👍

@wesleycho
Copy link
Contributor

I suspect this might be the cause: c08509a

@wesleycho
Copy link
Contributor

If that is indeed the cause, the fix should be simple - on the $scope $destroy event, just clear out the tooltip from the stackedMap.

@RobJacobs
Copy link
Contributor

@wesleycho Verified that does in fact fix the problem. I can fix this as part of PR #4597 if you would like?

@wesleycho
Copy link
Contributor

Separate PR if possible

@Foxandxss
Copy link
Contributor

Yeah, separate always.

@maxklenk
Copy link
Author

Thank you for fixing this that fast!

aroop pushed a commit to aroop/bootstrap that referenced this issue Oct 16, 2015
The tooltip was not being removed from the stackedMap
resulting in a memeory leak.  Tooltip will now be
removed from the stackedMap in scope destroy
function.

Closes angular-ui#4610

Fixes angular-ui#4604
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants