Skip to content

Detached nodes after v-if component(Memory leaks) #13461

Closed
@hao-kuai

Description

@hao-kuai

Vue version

3.5.16

Link to minimal reproduction

https://github.com/hao-kuai/vue3-memory-leak-vif

Steps to reproduce

  1. Start the application by running pnpm dev.
  2. Open the application in your browser (e.g., http://localhost:5173).
  3. Open the browser's Developer Tools and select the "Memory" tab.
  4. Click the "Click me" button repeatedly. This will mount and unmount a DOM element.
  5. Take a heap snapshot after several clicks.
  6. Click the button several more times.
  7. Take another heap snapshot.
  8. Compare the snapshots. If there is a memory leak, you will see an increase in the number of detached HTMLDivElement objects in the second snapshot.

What is expected?

no detached objects

What is actually happening?

an increase in the number of detached HTMLDivElement objects

System Info

MacOS 15.5
M3 air
Chrome :137.0.7151.69 (arm64)

Any additional comments?

Although it is similar to 12306, I did not reproduce the Chrome issue in demo, so I hope you don't close the issue directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions