Ah, the flag is under optimizations, didn't expect that. But setting -O memory-reservation=33554432 fixes the issue.
Lukas has marked this topic as resolved.
Ah yes to explain the various flags where -W affects wasm semantics so -Wmax-memory-size limits the growth of the module at runtime. The -O flags are optimization/tuning flags and memory-reservation has a big impact on perf. That being said for platforms which don't support Cranelift (e.g. risc-v as you're using here) it's ok to set memory_reservation to zero (or something smaller as you are doing already)
This is a situation where the default settings for the host differ from the default settings of the target, so that's why the -Omemory-reservation=... flag is required when compiling the module
Last updated: Dec 06 2025 at 06:05 UTC