Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPA 内存泄漏自检一览 #17

Open
gaoryrt opened this issue Jul 11, 2022 · 0 comments
Open

SPA 内存泄漏自检一览 #17

gaoryrt opened this issue Jul 11, 2022 · 0 comments

Comments

@gaoryrt
Copy link
Member

gaoryrt commented Jul 11, 2022

  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/

@gaoryrt gaoryrt changed the title SPA 内存泄漏自检一览表 SPA 内存泄漏自检一览 Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant