Struct wiggle::wasmtime_crate::InstanceLimits [−][src]
pub struct InstanceLimits {
pub count: u32,
}
Expand description
Represents the limits placed on instances by the pooling instance allocation strategy.
Fields
count: u32
The maximum number of concurrent instances supported (default is 1000).
This value has a direct impact on the amount of memory allocated by the pooling instance allocator.
The pooling instance allocator allocates three memory pools with sizes depending on this value:
-
An instance pool, where each entry in the pool can store the runtime representation of an instance, including a maximal
VMContext
structure (seeModuleLimits
for the various settings that control the size of each instance’sVMContext
structure). -
A memory pool, where each entry in the pool contains the reserved address space for each linear memory supported by an instance.
-
A table pool, where each entry in the pool contains the space needed for each WebAssembly table supported by an instance (see
[ModuleLimits::table_elements
] to control the size of each table).
Additionally, this value will also control the maximum number of execution stacks allowed for asynchronous execution (one per instance), when enabled.
The memory pool will reserve a large quantity of host process address space to elide the bounds checks required for correct WebAssembly memory semantics. Even for 64-bit address spaces, the address space is limited when dealing with a large number of supported instances.
For example, on Linux x86_64, the userland address space limit is 128 TiB. That might seem like a lot, but each linear memory will reserve 6 GiB of space by default. Multiply that by the number of linear memories each instance supports and then by the number of supported instances and it becomes apparent that address space can be exhausted depending on the number of supported instances.
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for InstanceLimits
impl Send for InstanceLimits
impl Sync for InstanceLimits
impl Unpin for InstanceLimits
impl UnwindSafe for InstanceLimits
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more