Stream: general

Topic: controlling guest memory growth


view this post on Zulip Alex Vidal (May 12 2020 at 04:04):

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?

view this post on Zulip Dan Gohman (May 12 2020 at 17:39):

Wasm itself has a concept of a maximum size for a linear memory, which Wasmtime enforces.

view this post on Zulip Dan Gohman (May 12 2020 at 17:40):

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.

view this post on Zulip Alex Vidal (May 12 2020 at 18:20):

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?

view this post on Zulip Alex Vidal (May 12 2020 at 18:21):

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)

view this post on Zulip Alex Crichton (May 12 2020 at 18:44):

@Alex Vidal you can further limit it using the Config::with_host_memory method which allows hooking all calls to memory growth

view this post on Zulip Alex Vidal (May 12 2020 at 18:50):

ah, looks like that isn't exposed in wasmtime-go atm?

view this post on Zulip Alex Crichton (May 12 2020 at 18:54):

True yeah, those sorts of interfaces have not been bound yet


Last updated: Dec 23 2024 at 12:05 UTC