Expand description
Process-level memory bounds and limiting for components.
This module lets components declare their expected memory usage and supports enforcing process-wide memory limits:
- memory bounds: components declare their expected memory usage (a minimum required
amount and a firm limit) via the
MemoryBoundstrait andMemoryBoundsBuilder, - bounds verification:
BoundsVerifierchecks that the combined bounds of all components fit within aMemoryGrant, - memory limiting:
MemoryLimiterapplies cooperative backpressure as the process approaches a configured memory limit, - component registry:
ComponentRegistryties these together, providing a nestable structure of components that can each declare bounds and register a resource group for runtime usage tracking.
Actual (as opposed to expected) memory usage and CPU time are tracked separately via the
resource-tracking primitives in [saluki_common::resource_tracking]; the tracking allocator
found there must be installed as the global allocator for runtime usage to be attributed to
registered components.
Structs§
- Bounds
Verifier - Memory bounds verifier.
- Component
Bounds - Memory bounds for a component.
- Component
Registry - A registry for components for tracking memory bounds and runtime memory usage.
- Component
Registry Handle - A cloneable, read-only handle to a component registry.
- Memory
Bounds Builder - Builder for defining the memory bounds of a component and its subcomponents.
- Memory
Grant - A memory grant.
- Memory
Limiter - A process-wide memory limiter.
- ResourceAPI
Handler - An API handler for reporting the resource usage and usage of all components.
- Verified
Bounds - Verified bounds.
Enums§
- Usage
Expr - Represents a memory usage expression for a component.
- Verifier
Error - A verification error.
Traits§
- Memory
Bounds - Memory bounds for a component.