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

2.0.1: Memory leak when an element in a component has a handlebars'd attribute #12265

Closed
arthare opened this issue Sep 1, 2015 · 5 comments
Closed

Comments

@arthare
Copy link

arthare commented Sep 1, 2015

This appears to have been present at least as far back as 1.13.5. It is separate from the other memory leak I mentioned earlier today that was fixed in 1.13.4.

Sample app: https://github.com/arthare/leakyEmberApp
Repro instructions are in the readme.md in that github.

Based on my research, it looks like whenever a DOM element in a component has an attribute made using a handlebars expression, the entire component gets leaked on route transitions.

Example: This will leak [inside a component's template]:

<span fake-attrib="leaky-{{product.id}}">The parent span of this text might be leaky!</span>

This will not [inside a component's template]:

<span fake-attrib="leaky-5">The parent span of this text might be leaky!</span>

Other tidbits:

  • The element with the handlebars'd attribute has to be inside a component. I tried putting the same span in my route, and the leaks didn't happen.
  • The amount leaked is proportional to the element count of the component, but is not affected by the element count of the containing route. This seems to indicate the rendered component is being leaked, but not the route.
  • I first noticed this in my 1.13.5-based app, and repro'd it up to 1.13.9 in that app, and have repro'd it in 1.13.5, 1.13.9, and 2.0.1 in the toy app.
@stefanpenner
Copy link
Member

can you try master? As this appears related to: #12256

Cherry picked into release-1-13 branch, when Travis is done you should be able to bower install --save ember#release-1-13 to get this fix.

source: @rwjblue -> #12256 (comment)

@raytiley
Copy link
Contributor

raytiley commented Sep 1, 2015

I think this might be fixed with #12256

There was a leak in concat which is used to combine the strings.

@arthare
Copy link
Author

arthare commented Sep 1, 2015

That sounds exactly like it. Will give it a try.

@rwjblue
Copy link
Member

rwjblue commented Sep 1, 2015

Thanks for the thorough bug report, please confirm with latest builds that it is indeed fixed. You should be able to use latest builds from any channel to get the fix from #12256.

@arthare
Copy link
Author

arthare commented Sep 1, 2015

That did it. Thanks everyone. What a coincidence that it got PR'ed today just as I narrowed it down on my end.

@arthare arthare closed this as completed Sep 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants