I'm trying to build a WASM file for node where I can allocate more than 4GB.
I am compiling with the following settings
-s MODULARIZE=1 -s WASM=1 -s NO_EXIT_RUNTIME=1 --bind -s MAXIMUM_MEMORY=8GB -s FILESYSTEM=0 -s USE_ZLIB=1 -O3 -s MEMORY64 -s ASSERTIONS -s ALLOW_MEMORY_GROWTH=1
It is also definitely compiled under 64 bit as I get e.g. sizeof(size_t) as 8.
I run my node with the --experimental-wasm-memory64 command.
My node version is v18.16.0
However, I get a runtime exception:
failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): maximum memory size (131072 pages) is larger than implementation limit (65536) @+3843
If I set -s MAXIMUM_MEMORY=4GB it runs fine, but then I cannot allocate more than 4GB of memory.
What am I doing wrong here?
My emscripten version is
emcc -v:
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.37 (d02c29f95e9e68f2f50c2b0432c56a671814d5c8)
clang version 17.0.0 (https://github.com/llvm/llvm-project 86339ef088e9aac6cf52cf9022d7a5bd144d4c42)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: D:\cmPlatform\emsdk.git\upstream\bin
I'm trying to build a WASM file for node where I can allocate more than 4GB.
I am compiling with the following settings
-s MODULARIZE=1 -s WASM=1 -s NO_EXIT_RUNTIME=1 --bind -s MAXIMUM_MEMORY=8GB -s FILESYSTEM=0 -s USE_ZLIB=1 -O3 -s MEMORY64 -s ASSERTIONS -s ALLOW_MEMORY_GROWTH=1It is also definitely compiled under 64 bit as I get e.g.
sizeof(size_t)as 8.I run my node with the
--experimental-wasm-memory64command.My node version is
v18.16.0However, I get a runtime exception:
failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): maximum memory size (131072 pages) is larger than implementation limit (65536) @+3843If I set
-s MAXIMUM_MEMORY=4GBit runs fine, but then I cannot allocate more than 4GB of memory.What am I doing wrong here?
My emscripten version is