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

Detached DOM nodes not deleted after changing page #1319

Closed
nicolas-t opened this issue Apr 9, 2017 · 3 comments
Closed

Detached DOM nodes not deleted after changing page #1319

nicolas-t opened this issue Apr 9, 2017 · 3 comments

Comments

@nicolas-t
Copy link

Version

2.4.0

Reproduction link

http://jsfiddle.net/3xu0o52g/5/embedded/result/

Steps to reproduce

On the JSFiddle

  1. click the first link "go to bar", it'll render a list of 80 DOM nodes
  2. with chrome dev tool take a first heap snapshot, type "Detached" in the Class filter
    this is what you should get http://imgur.com/Zz1LDY6
  3. click the "go to foo" link
  4. with chrome dev tool take a second heap snapshot, type "Detached" in the Class filter
    this is what you should get http://imgur.com/5bVLudr

our 80 DOM nodes are still in memory

What is expected?

Detached DOM nodes from previous pages should be removed from memory when changing page

What is actually happening?

Detached DOM nodes from previous pages are kept in memory, and make the app unusable in case of multiple list of 100 items made of multiple DOM nodes


The full JSFiddle is here : https://jsfiddle.net/3xu0o52g/5/
I ran into this bug displaying multiple galleries (on different pages) "masonry like" of 100 images.
I really hope it's not the expected behavior, because it makes my app unusable after a few pages.

@nicolas-t nicolas-t changed the title Detached DOM nodes not deleting after changing page Detached DOM nodes not deleted after changing page Apr 9, 2017
@rayeyeued
Copy link

I come for this too!

@yyx990803
Copy link
Member

I can't reproduce any leaks with your fiddle - having detached nodes in memory doesn't mean there's a leak. If you take more snapshots as you switch between the routes, you will notice that every heap snapshot has the same size, and if you compare the snapshots you will see that while there are detached nodes in memory, they are in fact collected in the next snapshot.

@nicolas-t
Copy link
Author

nicolas-t commented Apr 25, 2017

@yyx990803 Thanks for your answer.

Ive updated the fiddle with one more page (/baz):
https://jsfiddle.net/3xu0o52g/6/
When switching to /baz detached DOM nodes are still present.
But as I'm not very familiar with memory leak debugging maybe this is not what's causing my app to become so slow.
I'll work on improving my understanding of memory leaks and dev tools :)

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

3 participants