Skip to content
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 problem with (Dom Node) Download #9003

Closed
YusufEminDemirci opened this issue Aug 18, 2023 · 1 comment
Closed

Memory leak problem with (Dom Node) Download #9003

YusufEminDemirci opened this issue Aug 18, 2023 · 1 comment

Comments

@YusufEminDemirci
Copy link

YusufEminDemirci commented Aug 18, 2023

Vue version

3.3.4

Link to minimal reproduction

https://play.vuejs.org/#eNqlU02P2jAQ/StWTiBBzGp7orASqfawrdRW2x5zMclgzDq25XFSEOK/d2wI0O0WVdocEHnvzeTN1z5bOJd3LWTTbBagcVoEeCgNo2f2BcAttOp6IIGVbZw1YAKbKpyX2fm9zBjvI/l16IxfJaZXrLxygSGE1jEtjKQsAcuMWEW5fGAFW3nbsDLLeRHNldnHM7e4cIvX3J7hWmhtfz3Dih16YS8qjYbAvG0DsDmbEFJZg4FdKppfxQ8WwxRDNp9MAN8JPRgM2fyB7Y9FqhUbnJLNKd2wx+NzTplTWBs/V1Cynu0t3J2wAwONcDt+8UZ8LCHFl+YwYneTySRanvFjg0/NDjsNDCvroO6bjRXGdpMwkqTLRjQAasZKyXyD1tAyJDPH6SoN/psLippVZtPeZpmlTn1OWPAtjHq8WkP18ga+wW3Eyuy7B6SG0lTOXBBeAq1QpB9/fIUt/T+Tja1bTeob5DOg1W30eJQVranJ9pUuuX1Ke6KM/ImP2wAG+6Ki0ag8JH3amU83Sr/Yvc/vUxyNgLqYNjKe0j93/M/pvL441UiGviLxOgSHU86XXpjaGm+X4APmNXRcIKVF7izSr8Dg7VhbafONk6cb/Ovi/nMJ0rG9w36narCsoe2smWiDJXJ3VQ+VQ/vUWFOLQL6tFxJyaa3UIJzCnEguQzdOaXC8bKsXCBwFfQR4oWRBAA3W7PLGfXhXqYffYSGnOA==

Steps to reproduce

1 - Create 2 Component or 2 Route.
2 - One is just tag, other one is just

What is expected?

When Route changes or Component changes or v-if toggles, old one must be destroyed and not drop detached nodes in memory.

What is actually happening?

When Route changes or Component changes or v-if toggles, drops detached node, not cleanable and increases continues. (When i take heap snapshot this detached dom nodes reduces)
image

System Info

No response

Any additional comments?

// A.vue

<script setup lang="ts"></script>

<template>
    <img src="https://brandonroberts.dev/assets/posts/astro-logo.jpg" />
</template>

<style scoped lang="scss"></style>
// B.vue

<script setup lang="ts"></script>

<template>
    <video muted autoplay src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" />
</template>

<style scoped lang="scss"></style>
// App.vue

<template>
    <KeepAlive>
        <component :is="component" />
    </KeepAlive>
</template>

<script setup lang="ts">
import { shallowRef } from "vue";

import A from "./A.vue";
import B from "./B.vue";

let route = 0;
const component = shallowRef(A_Page);

setInterval(() => {
    if (route === 0) {
        component.value = B;
        route = 1;
    } else {
        component.value = A;
        route = 0;
    }
}, 1000);
</script>

<style scoped lang="scss"></style>
@edison1105
Copy link
Member

duplicate of #5256

@edison1105 edison1105 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants