Skip to content

SPA 内存泄漏自检一览 #17

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/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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