-
Notifications
You must be signed in to change notification settings - Fork 668
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
Possible memory leak? #1058
Comments
Could this be related to #892? I'm experiencing both symptoms: as I re-run my tests with a mocha watcher they get slower (some event timeout) and the heap size keeps growing. Eventually, I get a I've also observed that manual GC don't help and a lot of |
@meis FWIW, we have been having this issue since at least beta 10. |
Thanks for the report. The main issue I found is cached constructors added to component options objects, which results in lots of VueComponent instances that can't be garbage collected. This is likely why VueComponent objects weren't removed even after calling I'll also add a Another issue I found is that some plugins keep references to instances. I'll investigate this further. |
Thanks a lot @eddyerburgh. I've had the chance to quickly test the new version (1.0.0-beta.27) this afternoon. My numbers show an improvement of roughly 50% of the heap growth compared to the last version. This means that, on subsequent runs of the test suite, the heap only increases ~50KB instead of the ~100KB growth I was observing before. At this point, it's not clear for me which module is responsible for the remaining leaks, but your change certainly helped! |
Thanks for this progress! I have done some further testing and found some leaks within vue-router. There are event listeners that hold onto components forever. Trying to determine if there is a quick solution to this particular problem. Not sure if anyone else is also using vue-router. |
Related: vuejs/vue-router#2341 |
I have seemed to find this
|
There are two memory leaks I can identify:
(@mmase I'm going to close this issue in favor of #892 which is tracking the same issue. |
Version
1.0.0-beta.26
Steps to reproduce
What is expected?
Vue components are garbage collected
What is actually happening?
80% of
VueComponent
instances are retained in memory; even after callingwrapper.destroy
after each instance. Heap size continues to grow and grow over time. Garbage collection occurs (either automatically or by force), but only a minimal amount is removed from memory.The text was updated successfully, but these errors were encountered: