It seems that DOM nodes are not collectable by GC on first route visit under specific circumstances.
npm install
npm run servep
- Serve production build
- Open browser and navigate to locally served project (e.g.
localhost:5000
) - Open dev tools
- Navigate to "Case 3" and back to "Home"
- Issue garbage collection manually
(DOM nodes from "Case 3"-view stick) - Navigate again to "Case 3" and back to "Home"
- Issue garbage collection manually
(DOM nodes from "Case 3"-view visit 1 still stick, but DOM nodes from visit 2 are GC'ed)
Optional:
Confirm DOM nodes from "Case 1" and "Case 2" routes are GC'ed as expected
(to rule out FooBar.List.vue as mem leak source):
- Navigate to "Case 1|2" and back to "Home"
- Issue garbage collection manually (DOM nodes from "Case 1|2" are GC'ed)
Confirm DOM nodes of FIRST visit stick (and not from the last visit):
Case 4
has 100 list itemsCase 4 (500 items)
has 500 list items
The number of detached / leaked nodes depend on which version of the case 4 view was opened first.
Components with a single root and multiple children cause memory leak:
<template>
<h1>Case 1 (no mem leak)</h1>
<FooBarList/>
</template>
<template>
<div>
<FooBarList/>
</div>
</template>
<template>
<div>
<h1>Case 3 (mem leak)</h1>
<FooBarList/>
</div>
</template>
Each route opened the first time contributes to a new baseline.
(numbers = case view opened / GC'ed)
npm run serve
npm run build
npm run lint