Stream: git-wasmtime

Topic: wasmtime / issue #3564 Question: How much memory does was...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 29 2021 at 12:55):

PureWhiteWu opened issue #3564:

As title discribes, I wonder how much memory does wasmtime allocates to an instance by default.

I ran into some strange behaviour, and I need to confirm this first.

Thanks.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 29 2021 at 13:56):

bjorn3 commented on issue #3564:

On 64bit systems wasmtime reserves 6GB by default for the wasm linear memory I believe. Only the part corresponding with the size of the linear memory as the wasm module sees it is allocated. The rest doesn't use RAM. Each wasm module sets it's own default size for the linear memory. https://github.com/bytecodealliance/wasmtime/blob/81f6228c574670dcdacd42e40ce53e9e1a685a15/crates/environ/src/tunables.rs#L51-L57

view this post on Zulip Wasmtime GitHub notifications bot (Nov 29 2021 at 13:56):

bjorn3 edited a comment on issue #3564:

On 64bit systems wasmtime reserves 6GB by default for the wasm linear memory. Only the part corresponding with the size of the linear memory as the wasm module sees it is allocated. The rest doesn't use RAM. Each wasm module sets it's own default size for the linear memory. https://github.com/bytecodealliance/wasmtime/blob/81f6228c574670dcdacd42e40ce53e9e1a685a15/crates/environ/src/tunables.rs#L51-L57

view this post on Zulip Wasmtime GitHub notifications bot (Nov 29 2021 at 13:56):

bjorn3 edited a comment on issue #3564:

On 64bit systems wasmtime reserves 6GB for the wasm linear memory by default. Only the part corresponding with the size of the linear memory as the wasm module sees it is allocated. The rest doesn't use RAM. Each wasm module sets it's own default size for the linear memory. https://github.com/bytecodealliance/wasmtime/blob/81f6228c574670dcdacd42e40ce53e9e1a685a15/crates/environ/src/tunables.rs#L51-L57

view this post on Zulip Wasmtime GitHub notifications bot (Nov 29 2021 at 15:41):

PureWhiteWu commented on issue #3564:

@bjorn3 Thanks!
I've found something quite strange and submited another issue #3565 so close this now.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 29 2021 at 15:42):

PureWhiteWu closed issue #3564:

As title discribes, I wonder how much memory does wasmtime allocates to an instance by default.

I ran into some strange behaviour, and I need to confirm this first.

Thanks.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 29 2021 at 15:53):

alexcrichton commented on issue #3564:

Note that the number reported above is not accurate, the full default address space reservation is 8GB large. There's a 2GB guard region, the 4GB region for a 32-bit memory, and a trailing 2GB guard region. All of this is configurable via the Config struct and its various methods as well.


Last updated: Nov 22 2024 at 16:03 UTC