Stream: git-wasmtime

Topic: wasmtime / issue #12445 wasmtime: don't use memory_reserv...


view this post on Zulip Wasmtime GitHub notifications bot (Jan 27 2026 at 12:17):

tage64 opened issue #12445:

In the function MallocMemory::new() (in the file /crates/wasmtime/src/runtime/vm/memory/malloc.rs), we allocate minimum + tunables.memory_reservation_for_growth bytes. I was working in a bare metal context and therefore didn't have access to virtual memory. An error message kindly told me that "malloc memory is only compatible with no ahead-of-time memory reservation". This led me to set config.memory_reservation(0). But then memory_reservation_for_growth still defaulted to 2 GiB causing the MallocMemory to allocate more than 2 GiB of memory. This time I didn't get a helpful error message but an allocation failure without further context.

Is there a reason why we even use the memory_reservation_for_growth option in the MallocMemory? Otherwise I propose that we either ignore it or throw an error if it is greater than 0.

Wasmtime version: 41.0.0

view this post on Zulip Wasmtime GitHub notifications bot (Jan 27 2026 at 14:48):

alexcrichton commented on issue #12445:

This knob is used to amortize the cost of growth of a memory because without it all wasm growth would require reallocating the memory and moving it around. In that sense it's an intentional knob that is indeed used, but improving error messages for allocation failures is always reasonable.

Are you unable to set this configuration option to 0? Or are you interested in having it default to 0 for your target so you don't have to configure it?


Last updated: Jan 29 2026 at 13:25 UTC