memory leak with MenuTab component #1496
Comments
Thanks for opening this issue! A maintainer will review this in the next few days and explicitly select labels so you know what's going on. If no reviewer appears after a week, a reminder will be sent out. |
vuejs/vue#9842 looks very similar but it is not the same. The open (and seemingly stale) PRs to resolve it don't fix this issue (e.g. vuejs/vue#9875) as I just tested them. |
Is this related to #1498? I'm creating the code to reproduce this issue. |
I've created the following environment for the test. Everything is created using clean components
├── HelloWorld.vue
├── MenuTab
│ ├── Index.js
│ ├── MenuTabItem.vue
├── utils
│ ├── VNodes.js <template>
<div>
<MenuTab>
<MenuTabItem label="nothing" :badguy="badguy" />
</MenuTab>
</div>
</template> And using Could you please provide more details on how to reproduce this issue? If you send me your repo I could take a look into it. |
I have been able to reproduce this on the current |
Okay, code sent to Alex. Hopefully you guys will be able to take it from there! |
Closing, no longer relevant for 3.0 |
This issue has been closed. If you wish to re-open it please provide additional information. |
Components inside a
MenuTabItem
can cause a memory leak if any of theprops
of the component change often. This is problematic for plugins that make use of theMenuTab
.Whatever value is set as a
prop
is stored in memory. Even when the value of theprop
changes, the old value is retained in memory too. So if theprop
value changes constantly, all the previous values are still stored in memory too. This will cause the memory usage to rise and rise and rise until it runs out of memory and aborts or crashes.When the component is not inside a
MenuTabItem
the oldprop
values are not stored in memory, thus there is no leak. That means the problem lies within theMenuTab
andMenuTabItem
components.Expected Behavior
There should not be a memory leak.
Current Behavior
There is a memory leak.
Steps to Reproduce (for bugs)
I'm not able to provide a live demo or code at present but please reach out to me if necessary. In the meantime, steps to reproduce are as follows:
prop
. It's easier to replicate if yourprop
is an array with many values, but it works with strings too.MenuTabItem
within aMenuTab
.prop
.MenuTab
hierarchy and repeat the test.Context
It is inhibiting my work creating plugins as I have to try to make a clone of the
MenuTab
component sans memory leak. If my component inside theMenuTab
remains open for long enough, it'll crash with an OOM error because theprop
value continually changes. If I isolate it outside of aMenuTab
the memory usage remains low and static.Your Environment
develop
and 2.6.2The text was updated successfully, but these errors were encountered: