I have a C++ application using the V8 library that runs JavaScript+WASM code (say, xyz.js) generated by Emscripten compiler. If I run an infinite loop (for (;;) {}) in V8 and measure memory footprint of each additional isolate running in its own thread, it comes to be around 1.1 MiB.
However, if I run xyz.js, the memory footprint is around 40 MiB. The JavaScript part of xyz.js is around 200 KiB, and the WASM part (encoded in base64) is around 800 KiB. It doesn't seem normal for such small code to compile into dozens of megabytes.
The C++ code is very similar to the V8 Hello World sample with minor refactoring.
Is there any way to reduce the memory footprint of Isolates? I tried disabling the JIT but that also disabled WASM support.