Potential memory leak with keep-alive elements hidden early
Version
3.2.28
Reproduction link
Steps to reproduce
- Open memory panel in chrome devtools, run the garbage collection, then take heap snapshot (of 'mbwyj' instance),
- Click twice on the "toggle" button,
- Run the garbage collection and take a heap snapshot again, filter by "Detached"
- Click a pair number of times on the "toggle" button,
- Run the garbage collection and take a heap snapshot again, filter by "Detached"
What is expected?
The number of detached elements should not increase after each pair of clicks
What is actually happening?
The number of detached elements is increasing after each pair of clicks
Funnily, the problem does not happen if either of this is done:
- Comment the
beforeUnmount() {},
inBeforeUnmountComponent
- Move the
<div v-for="x in 100" :key="x">
fromApp.vue
to within the keep-alive ofKeepAliveComponent
Might be related to https://github.com/vuejs/core/issues/5278, and relates to https://github.com/quasarframework/quasar/issues/11804