alexcrichton commented on issue #1872:
I believe nowadays the
ResourceLimiter
trait should suffice for limiting the memory of a wasm instance.
alexcrichton closed issue #1872:
Hi, If you specify
static_memory_maximum_size(0)
then wasmtime will use dynamic memory for the linear wasm memory. If you don’t set it, by default the memory will be static. I note that settingstatic_memory_maximum_size
to anything less than 4GB on my platform results in wasm using dynamic memory and setting it above that it uses static memory. So the maximum memory (in my case anyway) is 4GB. I can see in the code that it sets the default of 4GB, but I cannot see how this is configurable, if it is?I also note that for my wasm module the memory starts at 22 pages (of size 64K each). On top of that I can only allocate about 1/3 of 4GB before the allocations in the wasm module fail, even though the device has 16GB memory and not running much more than the wasm host and the wasmtime max memory is at 4GB. This observed 1/3 of 4 GB limit is present whether wasmtime uses dynamic memory (
static_memory_maximum_size(0)
) or static memory. Does this make sense?
Last updated: Nov 22 2024 at 16:03 UTC