Hi, me @Marcin Kolny and @Enrico Loparco were discussing that usage of shared memory in WASI increases chances of crashes - if not enough memory was allocated upfront or too much memory was allocated upfront it can cause a crash.
We discussed an idea of introducing virtual memory when shared memory is used:
It makes memory non-linear underneath so I wonder if there was a thread or discussion in WASM/WASI sometime ago about it. So far I found only https://github.com/WebAssembly/multi-memory/blob/main/proposals/multi-memory/Overview.md that can make usage of shared memory less limiting
@Wenyong Huang @Andrew Brown let me know what your thoughts on that
The idea reminds me of the memory control proposal, though maybe at a different level: https://github.com/WebAssembly/memory-control/blob/main/proposals/memory-control/Overview.md. Is there a way that could be used to solve the problem you're raising?
(Just to check: the problem you're describing does not have to do with linear memory C stacks managed by the toolchain?)
Hey, thank you for the response Andrew
does not have to do with linear memory C stacks managed by the toolchain?)
It does not (in my understanding)
Is there a way that could be used to solve the problem you're raising?
I'm not sure. I guess this proposal would allow to release some memory if I read it right and that's not exactly what we're looking for. But would it allow to grow WASM memory even if shared memory is used? That is the main interest at the moment as max-memory is a very strict requirement
Last updated: Dec 23 2024 at 12:05 UTC