Closed Kasheftin closed 3 years ago
That's vuex4 issue. If I replace vuex with just a plain array in data, everything works as expected (no memory leak): Example 3 (vue3 without vuex): https://kasheftin.github.io/vuex4-memory-leak-example3/ Source code: https://github.com/Kasheftin/vuex4-memory-leak-example3
If I'm reading this right, it seems the memory leak is caused by Vue Devtools chrome extension retaining a reference to the array. If I delete the extension, I can't reproduce the memory leak in your example2 url.
Good catch!
Vuex 4 has outdated devtools code form Vuex 3.
This should be fixed on Vuex 4.0.1 with the correct new Devtools support š
i update vuex to version v4.0.2 but memory leak persist in ssr
I see the memory leaks in SSR (Quasar project). The leaks disappear when I disable vuex.
also have the same memory leak issue in SSR using v4.0.2, please reopen this bug.
also have the same memory leak issue in SSR using v4.0.2, please reopen this bug.
i have used createVuexStore in serverRender file to resolve this problem
also have the same memory leak issue in SSR using v4.0.2, please reopen this bug.
i have used createVuexStore in serverRender file to resolve this problem
Can not find an API called createVuexStore. Where can find it?
first, you should find where are your store established in, erery page should establish a unrelated strore
first, you should find where are your store established in, erery page should establish a unrelated strore
In my case every SSR request create new vuex store, no store instance is reused, still have the leak. Think need an API to release or unload the Vuex instance.
Using devtools: false solved the problem for me
Thank you @Carseason we solved a huge problem of memory leak thanks to your comment.
Version
4.0.0
Reproduction link
https://kasheftin.github.io/vuex4-memory-leak-example2/
Steps to reproduce
What is expected?
There's exactly the same app for vue2.6 vuex3.4: https://kasheftin.github.io/vuex4-memory-leak-example1/ Exactly the same code gives the correct result there: memory is cleared up correctly there. It should be the same in vue3.0 vuex4.0.
What is actually happening?
Allocated memory is not cleared up in vue3.0 vuex4.0
vue2.6 vuex3.4 source code (working correctly):
https://github.com/Kasheftin/vuex4-memory-leak-example1
vue3.0 vuex4.0 source code (memory leak):
https://github.com/Kasheftin/vuex4-memory-leak-example2