Expand description
Generic memory management for resource-constrained operations.
This crate provides a reusable memory quota system based on semaphores, allowing different subsystems (compaction, flush, index build, etc.) to share the same allocation logic while using their own metrics.
Modulesยง
- error ๐
- granularity ๐
- guard ๐
- manager ๐
- policy ๐
Structsยง
- Memory
Guard - Guard representing a slice of reserved memory.
- Memory
Manager - Generic memory manager for quota-controlled operations.
- NoOp
Metrics - No-op metrics implementation for testing.
Enumsยง
- Error
- OnExhausted
Policy - Defines how to react when memory cannot be acquired immediately.
- Permit
Granularity - Memory permit granularity for different use cases.
Constantsยง
- DEFAULT_
MEMORY_ WAIT_ TIMEOUT - Default wait timeout for memory acquisition.
Traitsยง
- Memory
Metrics - Trait for recording memory usage metrics.