Skip to content

memory leaks on a cached static render functions #7184

@aanation

Description

@aanation

Version

2.5.9

Reproduction link

https://jsfiddle.net/pufjfwm8/2/

Steps to reproduce

(Chrome 60.0.3112.101)

  1. take the heap memory snapshot in chrome devtool
  2. click on "to big" link (go to the route with a lot components)
  3. click on "to small" link (return back to the small component)
  4. collect garbage in devtool
  5. take the second snapshot
  6. compate snapshots
  7. heap increase and vue cache div element ("I am big component!"). This element have the prop "context",
    that reference to "zombie" component. All zombie-components alive, but route have changed.

if you will repeat this actions, memory will leak.
If you remove "I am big component!"-div, memory does'nt leak.

What is expected?

cached nodes should not contain references to destroyed components

What is actually happening?

We have memory leak (1-2 GB) with large lists of components like this.


Memory leaks:
https://imgur.com/fnaC1vS

Memory does'nt leak:
https://imgur.com/WPiCZ0A

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