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

Memory leak issue when transitioning from route. #4541

Closed
Yogananthan opened this issue Mar 17, 2014 · 9 comments
Closed

Memory leak issue when transitioning from route. #4541

Yogananthan opened this issue Mar 17, 2014 · 9 comments
Labels

Comments

@Yogananthan
Copy link

There is a memory leak while navigating from one route to another.

While transitioning to a route, the entire DOM of the previous rendered template gets added to the detached DOM tree increasing the memory consumed. This increases as the no.of nodes in that template increases.

Here is a JsBin illustrating the issue. Steps to reproduce:
1. Enter the test route directly.

before trans to home

2. From `test` route navigate to `index` route.

after trans to home
384 new nodes (the no.of nodes in the test template) gets added to the detached DOM tree

The issue seems to occur due to Ember.Select

@Yogananthan Yogananthan changed the title Memory leak when transitioning from route. Memory leak issue when transitioning from route. Mar 20, 2014
@trek trek added bug labels Mar 26, 2014
@wagenet
Copy link
Member

wagenet commented Apr 15, 2014

@machty something else up your alley!

@fabien-h
Copy link

Same behaviour here. But I'm not sure if this is a bug. Is ember willingly keeping those detached DOM tree ?

@wagenet
Copy link
Member

wagenet commented Jul 28, 2014

I suspect this will be improved by HTMLBars.

@wagenet wagenet closed this as completed Jul 28, 2014
@stefanpenner
Copy link
Member

@Yogananthan
maybe you can submit a index file + instruction for detecting this leak, so the HTMLBars/metal-view people can confirm the problem is gone

@arthare
Copy link

arthare commented Sep 1, 2015

This is definitely not fixed (or a new but very similar memory leak has arisen in 1.13). My symptoms are very similar to Yogananthan's, including the leaked DOM trees proportional to the size of the templates involved.

Here's a github demo: https://github.snei.sony.com/ahare/leaky-app

Just follow the readme.md for setup instructions. Checkout commit 4fd324f829 to watch it leak a big component on every transition.

Here's my stackoverflow post where it was encouraged I post here instead: http://stackoverflow.com/questions/32332957/memory-leak-on-route-transition-in-very-simple-ember-1-13-app?noredirect=1#comment52542584_32332957

@stefanpenner
Copy link
Member

@arthare can you open a new issue. And be sure to test on the latest 1.13 and also 2.0

@arthare
Copy link

arthare commented Sep 1, 2015

K, will do.

@arthare
Copy link

arthare commented Sep 1, 2015

Updated to 2.0.1, and it is fixed. I guess that'll do for now.

@kingpin2k
Copy link
Contributor

It was fixed in 1.13.4 @arthare #11667

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants