-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
Discussed in #17699
Originally posted by ryan-weisenberger August 22, 2022
% ./emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.19 (a5f7b1c9a1c74a830bebedc122d204800ce8dff9)
clang version 16.0.0 (https://github.com/llvm/llvm-project 30171e76f0e5ea8037bc4d1450dd3e12af4d9938)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /Users/misha/wahoo/systm/crux_tools/submodules/emsdk/upstream/bin
We have a memory leak when calling our WASM through javascript generated by emscripten 3.1.19.
Our WASM converts a CSV file to a binary file in memory. Every time the converter finishes, it leaves behind a FSNode object. So after several hundred conversions, we get several hundred of these FSNode objects clogging up memory.
I'm using Node's v8.getHeapSnapshot() to take a heap snap before the conversions, after the conversions, and again after I have forced run the GC. I'm attaching those snapshots here.
The number of FSNode objects left over exactly matches the number of conversions. In this case, 978.
We've gone over the WASM code quite extensively, and cannot find a memory leak.
Any ideas what could cause this, and how to resolve it? If this looks like an emscripten problem, I can move this to Issues.
Thanks,
Ryan
