Stream: wasmtime

Topic: ✔ Setting Memory Reservation of Compiled Module


view this post on Zulip Lukas (Jun 19 2025 at 08:15):

Ah, the flag is under optimizations, didn't expect that. But setting -O memory-reservation=33554432 fixes the issue.

view this post on Zulip Notification Bot (Jun 19 2025 at 08:15):

Lukas has marked this topic as resolved.

view this post on Zulip Alex Crichton (Jun 20 2025 at 00:13):

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