pub struct MemoryInfo {
pub total_memory: usize,
pub available_memory: usize,
pub page_size: usize,
pub bandwidth_gbps: f64,
pub latency_ns: f64,
pub numa_nodes: usize,
pub swap_info: SwapInfo,
pub pressure: MemoryPressure,
}Expand description
Memory system information
Fields§
§total_memory: usizeTotal physical memory in bytes
available_memory: usizeAvailable memory in bytes
page_size: usizeMemory page size in bytes
bandwidth_gbps: f64Memory bandwidth estimate (GB/s)
latency_ns: f64Memory latency estimate (nanoseconds)
numa_nodes: usizeNUMA nodes count
swap_info: SwapInfoSwap space information
pressure: MemoryPressureMemory pressure indicators
Implementations§
Source§impl MemoryInfo
impl MemoryInfo
Sourcepub fn detect() -> CoreResult<Self>
pub fn detect() -> CoreResult<Self>
Detect memory information
Sourcepub fn performance_score(&self) -> f64
pub fn performance_score(&self) -> f64
Calculate performance score (0.0 to 1.0)
Sourcepub fn optimal_chunk_size(&self) -> usize
pub fn optimal_chunk_size(&self) -> usize
Get optimal chunk size for memory operations
Sourcepub fn is_under_pressure(&self) -> bool
pub fn is_under_pressure(&self) -> bool
Check if memory pressure is high
Sourcepub fn allocation_strategy(&self) -> AllocationStrategy
pub fn allocation_strategy(&self) -> AllocationStrategy
Get recommended memory allocation strategy
Trait Implementations§
Source§impl Clone for MemoryInfo
impl Clone for MemoryInfo
Source§fn clone(&self) -> MemoryInfo
fn clone(&self) -> MemoryInfo
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 MemoryInfo
impl Debug for MemoryInfo
Auto Trait Implementations§
impl Freeze for MemoryInfo
impl RefUnwindSafe for MemoryInfo
impl Send for MemoryInfo
impl Sync for MemoryInfo
impl Unpin for MemoryInfo
impl UnwindSafe for MemoryInfo
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> 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