Skip to content

Memory leak (detached DOM tree) when Vue class component is used #209

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

Closed
bartsidee opened this issue Dec 16, 2017 · 1 comment · Fixed by #210
Closed

Memory leak (detached DOM tree) when Vue class component is used #209

bartsidee opened this issue Dec 16, 2017 · 1 comment · Fixed by #210
Labels

Comments

@bartsidee
Copy link

bartsidee commented Dec 16, 2017

Version

6.1.1

Reproduction link

Memory leak with Vue class component
https://jsfiddle.net/n1tvtwet/3/

Not reproduce-able, with vanilla vue js
https://jsfiddle.net/n1tvtwet/

Steps to reproduce

  1. open attached jsfiddle
  2. open chrome dev tools -> memory tab
  3. select the 'Home' route
  4. make a heap snapshot
  5. select the 'Foo' route
  6. make a heap snapshot
  7. select the last snapshot and use the 'comparison' tab
  8. in the search box enter 'detached'
  9. find the detached tree
  10. if you hover the red HTMLDivElement you will notice it is the dom element of the 'Home' component

What is expected?

we would expect that when we use vue-class-component it would not leak memory

What is actually happening?

detached nodes are found and memory is leaked when vue-class-component is used, while this is not the case when a vanilla vuejs solution is used.

@ktsn
Copy link
Member

ktsn commented Dec 17, 2017

Thanks for reporting this!
I've confirmed that it indeed has a memory leak and I found the cause of it. I'll fix it.

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

Successfully merging a pull request may close this issue.

2 participants