Expand description
§Memory Tracking Strategies
This module provides concrete implementations of memory tracking strategies optimized for different runtime environments.
§Available Strategies
SingleThreadStrategy
- Optimized for single-threaded applicationsThreadLocalStrategy
- Thread-local storage for multi-threaded appsAsyncStrategy
- Task-local tracking for async applicationsHybridStrategy
- Combined approach for complex environments
§Design Principles
All strategies implement the unified MemoryTracker
trait and follow:
- Zero-lock architecture: No mutex or rwlock usage
- Minimal overhead: <3% performance impact target
- Data compatibility: Consistent export formats
- Graceful fallback: Error recovery without data loss
Re-exports§
pub use async_strategy::AsyncStrategy;
pub use hybrid_strategy::HybridStrategy;
pub use single_thread::SingleThreadStrategy;
pub use thread_local::ThreadLocalStrategy;
Modules§
Structs§
- Performance
History - Performance history tracking for strategy optimization Maintains historical performance data to guide strategy selection
- Strategy
Factory - Strategy factory for creating appropriate tracker implementations Provides centralized strategy creation with proper configuration
- Strategy
Performance - Performance metrics for individual strategy Tracks key performance indicators for strategy evaluation
- Strategy
Requirements - Strategy selection requirements Defines criteria for optimal strategy selection