-
-
Notifications
You must be signed in to change notification settings - Fork 861
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 in vue-i18n when v-media-query is present #498
Comments
It seem same as vuejs/vue-class-component#291 |
Wait until Vue 2.6 is released. |
The actual issue is: A number of Vue plugins (including quite reknown ones), including v-media-query, keep track of all existing Vue instances / components via globally injected beforeCreate hooks, basically saving references to "this" of each created instance. Obviously, this functionality must rely on correct destruction of all instances, removing saved reference in beforeDestroy. "Normal" VueComponent instances are destroyed automatically by Vue. For manually created instances (not bound to a parent), however, $destroy has to be called manually. In vue-i18n component-based variant, a new Vue instance is created as A simple solution would be a call to As of now, existence of
Though there is surely a more elegant solution. |
@kazupon Should I open a new issue with the detailed description? Though reopening this one might make more sense as my use case is exactly the same (v-media-query) and the cause isn't exactly covered by the linked issue. |
I think I have same issue with Vuetify and Vue-i18n although in Nuxt. Memory goes out of bound after a while. What's the status on this one? Still solved with 2.6 ? |
vue & vue-i18n & v-media-query
2.5.21, 8.6.0, 1.0.3
Issue
vue-i18n
does not handle memory properly in presence of thev-media-query
library.It seems that when components that load i18n texts are deleted, the loaded texts are not properly wiped from memory.
As a result, the app usage more and more memory (especially when components are toggled by v-ifs) and the slower the app gets over time.
Steps to reproduce
I haven't used JSFiddle or a similar tool because the use of an iframe masks Vue's memory usage.
main.js
index.html
<div id="app"></div>
Watch the memory usage increase
Watch the memory usage go back to normal
v-media-query
library import and use from the codeWhat is expected?
Component loaded translations are removed from memory when the component is destroyed whether
v-media-query
is present or not.What is actually happening?
Component loaded translations are not removed from memory when a component is destroyed when
v-media-query
is present.The text was updated successfully, but these errors were encountered: