Get the latest tech news

JavaScript garbage collection and closures


GC within a function doesn't work like I expected

Posted 30 July 2024 Me, Surma, and Jason were hacking on a thing, and discovered that garbage collection within a function doesn't quite work like we expected. In this case, the engine knows it doesn't need to retain bigArrayBuffer beyond the initial execution of the function, as none of the future-callables access it. I thought engines would be smarter, and GC bigArrayBuffer since it's no longer referenceable, but that isn't the case.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of closures

closures

Related news:

News photo

Startups Face Grim Holiday Season as Layoffs, Closures Mount