Skip to content

Leakish behavior of something in signal graph which might cause performance degradation #14818

@gyzerok

Description

@gyzerok

Describe the bug

I've observed following in my project.

image

I've already seen very similar image, when reported a memory leak, which was fixed by Dominic in #13563.

Here it does not seems to be a leak, because the amount of detached nodes isn't growing as time goes. But it seems like something within the signal graph is kept with them and might affect performance by being recalculated needlessly.

Reproduction

I was not able to reproduce it exactly yet, but still have some similarities in what I've found.

Here is the REPL with the code.

  1. Record memory snapshot
  2. Click button twice
  3. Repeat 1-2 until you have 5 snapshots
  4. Filter snapshots with "react"
image image image

Notice how amount of things in memory is growing. It does not seem to be leak exactly, because it does not grow past this point, but it feels like something is not cleaned up properly. Also I am wondering if these things being kept in memory affect performance anyhow by still being checked on signal graph updates. Maybe in the bigger codebase amount of such leftovers could be more significant?

Logs

No response

System Info

Chrome 131.0.6778.205

Severity

annoyance

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