• Shaarli
  • Tag cloud
  • Picture wall
  • Daily
  • RSS
  • Login
4252 shaares
Filters

Fixing memory leaks in web applications | Read the Tea Leaves

QRCode

Modern web app frameworks like React, Vue, and Svelte use a component-based model. Within this model, the most common way to introduce a memory leak is something like this:

window.addEventListener('message', this.onMessage.bind(this));

That’s it. That’s all it takes to introduce a memory leak. If you call addEventListener on some global object (the window, the , etc.) and then forget to clean it up with removeEventListener when the component is unmounted, then you’ve created a memory leak.

http://nolanlawson.com/2020/02/19/fixing-memory-leaks-in-web-applications/
March 6, 2020 at 9:27:54 AM EST *
javascript memory
FILLER
Shaarli · The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community · Documentation
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community