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

Memory leak for vue3 vuex4 (__vue_devtools_global_hook__ is not cleared up) #1426

Closed
Kasheftin opened this issue Apr 29, 2021 · 2 comments
Closed

Comments

@Kasheftin
Copy link

Kasheftin commented Apr 29, 2021

Version

6.0.0-beta.8

Browser and OS info

Chrome 88 / Ubuntu 20

Steps to reproduce

The original issue is here: vuejs/vuex#1934

There's a trivial vue3 vuex4 app: https://kasheftin.github.io/vuex4-memory-leak-example2/

  • Load the app and use chrome devtools memory tab;
  • Take heap snapshot; The result is ~ 4.5 MB;
  • Press "Add" button. It will create 100 items in the store;
  • Take heap snapshot; The result is ~ 15.7 MB;
  • Press "Clear regular items" button. It will remove all items in the store;
  • Take heap snapshot; The result is still ~ 15.7 MB;
  • Add/remove items multiple times, notice the allocated space grows all the time;

That happens because of vue-devtools. If disable the extension -> no __vue_devtools_global_hook__ -> no memory leak.

What is expected?

Memory should be cleared up correctly

What is actually happening?

There's memory leak - memory usage grows all the time

@Akryum Akryum added the v6 label Apr 29, 2021
@Akryum
Copy link
Member

Akryum commented May 24, 2021

This is expected as part of the recording, please try clearing the timelines.

@Akryum Akryum closed this as completed May 24, 2021
@Kasheftin
Copy link
Author

Ok, then a very stupid question. What is devtools timelines and how to clear it? And why it happens on vuex4 but not on vuex3. I know about the performance tab, I can generate a report there and don't care about memory usage during this action. But that's just opening devtools, no performance report generation or whatever. On my opinion this should not lead to memory leak. And it should be possible to turn this functionality off using some hook variable in js source code. Is it possible? There're customers with devtools opened, and the real single page heavy app becomes unusable quite soon.

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

2 participants