Skip to content

.unmount() memory leak #2907

@wagoon

Description

@wagoon

Version

3.0.4

Reproduction link

http://wagoon.demoeshop.net/test-remove-vue.html

Steps to reproduce

  1. click first button to create new Vue app
  2. click second button to unmout it (and delete all pointers to that app)
  3. call garbage collector in chrome dev tools
  4. create memory snapshot (app is still in memory linked from vue_app)

What is expected?

According to doc, .unmount() in VUE3 is replacement for $destroy in vue2 => this method should destroy all app data to avoid memory leaks
Accordigt to 990803, unmounted app is not allegible for new mount(), so there is no need to store anything aboth it in memory (#1287 (comment))

What is actually happening?

App object stays linked from vue_app and cant be collected with garbage collector


Only solution i found is removing the target DIV from DOM
I descrobed all steps in detail on stackoverflow post https://stackoverflow.com/questions/65475604/vue-js-3-unmount-and-memory-leak

Metadata

Metadata

Assignees

Labels

🍰 p2-nice-to-havePriority 2: this is not breaking anything but nice to have it addressed.🐞 bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions