3 ms·
This isn't just because of 2 GC's working side by side. This happens to any memory that isn't a JavaScript object. So every asm.js and WebAssembly library is af
by CryZe 9y ago
This isn't just because of 2 GC's working side by side. This happens to any memory that isn't a JavaScript object. So every asm.js and WebAssembly library is affected by the same issue, even if it doesn't have its own garbage collector. With there no way of hooking into JavaScript's Garbage Collector, you can't free your native handles when the JavaScript object wrapper gets collected, so you get leaks all over the place. So the only option is to manually manage your JavaScript objects in your JavaScript code by calling their "destructors", which kind of defeats the whole purpose of having a Garbage Collector. With WebAssembly on the rise, I hope people become more aware of this issue and implement proper GC Hooks for JavaScript.