Does wasmtime have a mechanism to control or track exported memory? Or do we just have to check the size periodically and kill the program if it's too unwieldy?
Wasm itself has a concept of a maximum size for a linear memory, which Wasmtime enforces.
Currently Wasmtime will let applications request any maximum they want, but it'd be straightforward to add way to run applications with a lower maximum than they request.
ok so to confirm: wasmtime enforces the spec which dictates the max memory size in the guest, but there's currently no way, using wasmtime, to lower that max memory size?
currently i check memory size on every host call so i can abort if it gets too large (which hasn't happened yet since my instances exit pretty quickly)
@Alex Vidal you can further limit it using the Config::with_host_memory
method which allows hooking all calls to memory growth
ah, looks like that isn't exposed in wasmtime-go atm?
True yeah, those sorts of interfaces have not been bound yet
Last updated: Dec 23 2024 at 12:05 UTC