Web Directions Global Scope ’22 session spotlight–Strength in weakness: JavaScript memory management and weak references
Strength in weakness: JavaScript memory management and weak references
Garbage Collection (GC) in JavaScript is supposed to simplify and automate memory management. But it turns out that there are various scenarios where GC can get in the way, and avoiding resource leaks becomes challenging. In order to overcome such issues, the ECMAScript standard includes WeakMap and WeakSet. More recently, ES2021 introduced WeakRef and FinalizationRegistry for even more fine-grained control, and they are already supported by all modern browsers. In this presentation I explain what these are, why they’re needed, and provide concrete usage examples and best practices.
Dan Shappir
Dan Shappir is the Performance Tech Lead at Next Insurance, and previously held that position at Wix.com. Dan has over 25 years of software development experience, and has worked on systems ranging from multiuser games to missile trajectory simulations to designing and building large-scale Web applications used by hundreds of millions of users. He is a frequent speaker at technical conferences, a host and panelist on JavaScript Jabber podcast, and an Invited Expert on the W3C Web Performance Working Group. Dan holds an MSc in Computer Science.
Great reading, every weekend.
We round up the best writing about the web and send it your way each Friday.