-
Is there a means of limiting the amount of memory that a wasm app can use when invoked via wasmi? If not, is there interest in such a feature? My rationale is that I am looking to run "untrusted" code, hence wasm given its container-style properties. Relying on the 4GiB limit of WASM itself would not work well for resource-constrained target environments. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Actually, I've just discovered a way. Perhaps this will be useful for others... For completeness, another suggestion cited here: https://users.rust-lang.org/t/how-to-set-max-memory-limit-in-wasm/64725/10 The flags can also be declared in a .cargo/config.toml file so that a regular cargo build --target=wasm32-wasi command can be used: [target.wasm32-wasi]
rustflags = ["-Clink-args=--initial-memory=2621440 --max-memory=2621440"] The above will limit memory allocations to 40 pages. |
Beta Was this translation helpful? Give feedback.
-
The same question was just asked very recently: #720 |
Beta Was this translation helpful? Give feedback.
-
I'm going to close this given the discussion at #720. Thanks. |
Beta Was this translation helpful? Give feedback.
The same question was just asked very recently: #720