3 ms·
The consensus of "the same way they do in native code" is a probable approach, but it's worth calling out an additional complication in this setting: you might
by dllthomas 8y ago
The consensus of "the same way they do in native code" is a probable approach, but it's worth calling out an additional complication in this setting: you might wind up working with two garbage collectors, with references in one keeping objects in the other alive. This isn't intractable, but it is messy.
- jlokier 8y agoYes, like the IE memory leaks (and early Mozilla leaks) where DOM and JavaScript objects are collected in a different way, so can easily get stuck in unfreeable reference cycles. Old Frameworks have to do perverse things to break those cycles, and if they don't, the browsers leaked memory over time. It would be sad if that came back to modern browsers, due to WASM and DOM using separate collectors. Or worse, multiple WASM components, (perhaps in different languages, perhaps not, but all different collectors), holding indirect, accidental references to each other because someone decided to use the components in the same DOM.