-
-
Notifications
You must be signed in to change notification settings - Fork 150
F7 Webpack - VueComponents never garbage collected #263
Comments
It may not be specific to f7-router events. In my application I changed some components to trigger their existence based on |
Same for me. The problem is, if there is a div with an ID on it, you have it multiple times. I have had some issues out of that behavior. What I tried to solve that situation - add the following configuration parameters at init:
But same behavior ... |
Linked to #197 as well, where you can find a workaround for specific cases. |
These bugs affect the actual DOM items and they do get removed from the DOM - they don't get removed from the memory heap though. |
Any updates on this? |
Hi, I have created a sample repo: https://github.com/maxneuvians/vueF7MemoryLeakExample It illustrates the issue very nicely. You create a component using a After 18 toggles I went from 20 MB heap size to 145 MB heap size. I tried this in plain F7Vue without webpack and it did not happen there - no |
@scriptPilot I sat with @maxneuvians today and saw the problem first hand. |
@maxneuvians so the problem is in webpack? |
I currently can’t check it as I’m on vacation, but if you use some custom list component or just plain |
@nolimits4web I could not replicate it in https://github.com/nolimits4web/Framework7-Vue-Simple-Template with the exact same component set up. I replaced the
It will still retain the components. So this is not specific to just |
@nolimits4web using @maxneuvians example I can reproduce the issue with all of our phonegap-template-vue-f7-* templates that use webpack. |
Well ok, so how to unload component from browser memory? As far as I know browsers don’t really allow to control memory. Maybe problem related to Vue, such v-if thing is controlled by Vue, F7 doesn’t do anything with it. Events attaching/detaching is also controlled by Vue |
Without in-depth knowledge I would say that memory gets freed through the garbage collector. The memory is freed when it is no longer linked to its root. This issue vuejs/vue#6759 implies that the count of |
Ok, the issue is in the Vue itself, here is a simple test case https://jsfiddle.net/muy6kfn2/3/
|
And looks like it is fixed in latest version https://jsfiddle.net/0qb0kfmr/3/ |
From my findings the issue is caused by not detached event in case of component rendered with |
So closing as not F7 issue |
@nolimits4web Thank you for your work on the issue! Much appreciated! |
Thanks @nolimits4web |
Hi
I am really enjoying f7-vue but I am running into a problem where loading a new page adds VueComponents to the memory heap without cleaning them up.
The issue in one of my applications is that after 80-100 navigation events the memory usage is out of control.
To reproduce this you can use do the following:
https://github.com/framework7io/Framework7-Vue-Webpack-Template
About
linkBack
linkAbout
ones could be released?About
linkShould it not remain at 103 because those 9 components are already in memory? Or at least they should be freed and then replaced by the new ones?
I have tried a couple of configuration options like turning off
domCaching
on theview
. When I addreload
to the links I can see that thedestroyed()
event hook is called on the components but they do not get removed from memory.Please let me know if I am misunderstanding an implementation detail here.
Thanks for all your hard work!
The text was updated successfully, but these errors were encountered: