pub struct MemoryConfig {
pub enable_memory_pool: bool,
pub max_pool_size: usize,
pub min_pool_size: usize,
pub enable_zero_copy: bool,
pub enable_mmap: bool,
pub mmap_threshold: usize,
pub cleanup_interval: Duration,
pub eviction_policy: MemoryEvictionPolicy,
pub adaptive_strategy: AdaptiveStrategy,
pub target_hit_rate: f64,
pub enable_prefetching: bool,
pub enable_defragmentation: bool,
}Expand description
Configuration for memory optimizations
Fields§
§enable_memory_pool: boolEnable memory pool for tensor recycling
max_pool_size: usizeMaximum size of memory pool in bytes
min_pool_size: usizeMinimum size of memory pool (for adaptive strategies)
enable_zero_copy: boolEnable zero-copy tensor views
enable_mmap: boolEnable memory mapping for large tensors
mmap_threshold: usizeMinimum size for memory mapping (in bytes)
cleanup_interval: DurationPool cleanup interval
eviction_policy: MemoryEvictionPolicyEviction policy to use
adaptive_strategy: AdaptiveStrategyAdaptive strategy for dynamic sizing
target_hit_rate: f64Target hit rate for adaptive sizing (0.0 to 1.0)
enable_prefetching: boolEnable prefetching based on access patterns
enable_defragmentation: boolEnable automatic defragmentation
Trait Implementations§
Source§impl Clone for MemoryConfig
impl Clone for MemoryConfig
Source§fn clone(&self) -> MemoryConfig
fn clone(&self) -> MemoryConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MemoryConfig
impl Debug for MemoryConfig
Auto Trait Implementations§
impl Freeze for MemoryConfig
impl RefUnwindSafe for MemoryConfig
impl Send for MemoryConfig
impl Sync for MemoryConfig
impl Unpin for MemoryConfig
impl UnsafeUnpin for MemoryConfig
impl UnwindSafe for MemoryConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more