Skip to content

SPA 内存泄漏自检一览 #17

@gaoryrt

Description

@gaoryrt
  1. addEventListener 没有在 unmount 的时候 removeEventListener
  2. setTimeout / setInterval 没有在 unmount 的时候 clearTimeout / clearInterval
  3. IntersectionObserver / ResizeObserver / MutationObserver 没有 .disconnect()
  4. Promises / Obserbables / EventEmitters 一直 pending
  5. 全局对象储存
  6. 无限增长的 DOM

ref: https://nolanlawson.com/2020/02/19/fixing-memory-leaks-in-web-applications/

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