pub struct BoundedMemoryStats {Show 20 fields
pub config: BoundedStatsConfig,
pub total_allocations: usize,
pub total_allocated: usize,
pub active_allocations: usize,
pub active_memory: usize,
pub peak_allocations: usize,
pub peak_memory: usize,
pub total_deallocations: usize,
pub total_deallocated: usize,
pub leaked_allocations: usize,
pub leaked_memory: usize,
pub fragmentation_analysis: FragmentationAnalysis,
pub lifecycle_stats: ScopeLifecycleMetrics,
pub system_library_stats: SystemLibraryStats,
pub concurrency_analysis: ConcurrencyAnalysis,
pub recent_allocations: VecDeque<AllocationSummary>,
pub historical_summaries: VecDeque<HistoricalSummary>,
pub cleanup_count: u32,
pub last_cleanup_timestamp: Option<u64>,
pub total_allocations_processed: u64,
}
Expand description
Bounded memory statistics that prevent infinite growth
Fields§
§config: BoundedStatsConfig
Configuration for this instance
total_allocations: usize
Basic statistics (these don’t grow infinitely)
total_allocated: usize
§active_allocations: usize
§active_memory: usize
§peak_allocations: usize
§peak_memory: usize
§total_deallocations: usize
§total_deallocated: usize
§leaked_allocations: usize
§leaked_memory: usize
§fragmentation_analysis: FragmentationAnalysis
Analysis data (bounded)
lifecycle_stats: ScopeLifecycleMetrics
§system_library_stats: SystemLibraryStats
§concurrency_analysis: ConcurrencyAnalysis
§recent_allocations: VecDeque<AllocationSummary>
Bounded containers for detailed data
historical_summaries: VecDeque<HistoricalSummary>
§cleanup_count: u32
Cleanup statistics
last_cleanup_timestamp: Option<u64>
§total_allocations_processed: u64
Implementations§
Source§impl BoundedMemoryStats
impl BoundedMemoryStats
Sourcepub fn with_config(config: BoundedStatsConfig) -> Self
pub fn with_config(config: BoundedStatsConfig) -> Self
Create new bounded memory statistics with custom configuration
Sourcepub fn add_allocation(&mut self, alloc: &AllocationInfo)
pub fn add_allocation(&mut self, alloc: &AllocationInfo)
Add a new allocation, automatically managing bounds
Sourcepub fn update_active_allocation_status(
&mut self,
alloc: &AllocationInfo,
old_var_name_is_none: bool,
)
pub fn update_active_allocation_status( &mut self, alloc: &AllocationInfo, old_var_name_is_none: bool, )
Update the status of an active allocation, especially its var_name status. This is used when a var_name is associated with an already tracked allocation.
Sourcepub fn record_deallocation(&mut self, ptr: usize, size: usize)
pub fn record_deallocation(&mut self, ptr: usize, size: usize)
Record a deallocation
Sourcepub fn record_leak(&mut self, size: usize)
pub fn record_leak(&mut self, size: usize)
Record a memory leak
Sourcepub fn get_memory_usage(&self) -> MemoryUsageStats
pub fn get_memory_usage(&self) -> MemoryUsageStats
Get memory usage statistics for this stats instance
Sourcepub fn force_cleanup(&mut self)
pub fn force_cleanup(&mut self)
Force cleanup of old data
Sourcepub fn get_all_allocations(&self) -> Vec<AllocationInfo>
pub fn get_all_allocations(&self) -> Vec<AllocationInfo>
Get all allocations as a Vec (for compatibility with existing code)
Trait Implementations§
Source§impl Clone for BoundedMemoryStats
impl Clone for BoundedMemoryStats
Source§fn clone(&self) -> BoundedMemoryStats
fn clone(&self) -> BoundedMemoryStats
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 BoundedMemoryStats
impl Debug for BoundedMemoryStats
Source§impl Default for BoundedMemoryStats
impl Default for BoundedMemoryStats
Auto Trait Implementations§
impl Freeze for BoundedMemoryStats
impl RefUnwindSafe for BoundedMemoryStats
impl Send for BoundedMemoryStats
impl Sync for BoundedMemoryStats
impl Unpin for BoundedMemoryStats
impl UnwindSafe for BoundedMemoryStats
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