Stream: git-wasmtime

Topic: wasmtime / PR #5656 Always allocate `Instance` memory wit...


view this post on Zulip Wasmtime GitHub notifications bot (Jan 30 2023 at 21:03):

alexcrichton opened PR #5656 from always-malloc-instance to main:

This commit removes the pooling of Instance allocations from the pooling instance allocator. This means that the allocation of Instance (and VMContext) memory, now always happens through the system malloc and free instead of optionally being part of the pooling instance allocator. Along the way this refactors the InstanceAllocator trait so the pooling and on-demand allocators can share more structure with this new property of the implementation.

The main rationale for this commit is to reduce the RSS of long-lived programs which allocate instances with the pooling instance allocator and aren't using the "next available" allocation strategy. In this situation the memory for an instance is never decommitted until the end of the program, meaning that eventually all instance slots will become occupied and resident. This has the effect of Wasmtime slowly eating more and more memory over time as each slot gets an instance allocated. By switching to the system allocator this should reduce the current RSS workload from O(used slots) to O(active slots), which is more in line with expectations.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Jan 31 2023 at 22:45):

alexcrichton requested fitzgen for a review on PR #5656.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2023 at 17:22):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2023 at 17:57):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2023 at 18:04):

alexcrichton updated PR #5656 from always-malloc-instance to main.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2023 at 18:04):

alexcrichton has enabled auto merge for PR #5656.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2023 at 19:03):

alexcrichton updated PR #5656 from always-malloc-instance to main.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2023 at 19:37):

alexcrichton merged PR #5656.


Last updated: Nov 22 2024 at 17:03 UTC