Stream: git-wasmtime

Topic: wasmtime / issue #7594 Reserve memory


view this post on Zulip Wasmtime GitHub notifications bot (Nov 28 2023 at 13:28):

gggrafff opened issue #7594:

Hello!

Question:
I know how much memory will be needed when executing wasm code, can I somehow allocate the necessary amount of memory in advance to avoid allocations during execution?

I write wasm in golang and compile with tinygo

What I tried:

Thanks

view this post on Zulip Wasmtime GitHub notifications bot (Nov 28 2023 at 14:57):

alexcrichton commented on issue #7594:

This I think would typically be done through the WebAssembly module itself rather than the embedding API. For example WebAssembly memories list their minimum size and in this situation you'd ensure that the minimum size of memory was configured at the size you need. Wasmtime's allocation of linear memory then would reserve virtual memory for that and let it get lazily committed (at least on Linux, depends a bit on each OS).

Are you seeing behavior different though?


Last updated: Oct 23 2024 at 20:03 UTC