pub struct MemoryReport {
pub current_bytes: u64,
pub peak_bytes: u64,
pub total_allocated: u64,
pub total_deallocated: u64,
pub allocation_count: u64,
pub deallocation_count: u64,
pub regions: HashMap<String, RegionSnapshot>,
pub growth_rate_bytes_per_sec: Option<f64>,
pub snapshot_count: usize,
}Expand description
Memory profiling report.
Fields§
§current_bytes: u64Current memory usage in bytes.
peak_bytes: u64Peak memory usage in bytes.
total_allocated: u64Total bytes allocated since profiling started.
total_deallocated: u64Total bytes deallocated since profiling started.
allocation_count: u64Number of allocations.
deallocation_count: u64Number of deallocations.
regions: HashMap<String, RegionSnapshot>Per-region data.
growth_rate_bytes_per_sec: Option<f64>Memory growth rate (bytes per second), if calculable.
snapshot_count: usizeNumber of snapshots taken.
Implementations§
Source§impl MemoryReport
impl MemoryReport
Sourcepub fn is_stable(&self, threshold_bytes_per_sec: f64) -> bool
pub fn is_stable(&self, threshold_bytes_per_sec: f64) -> bool
Check if memory usage appears stable (no significant growth).
Sourcepub fn largest_region(&self) -> Option<(&String, &RegionSnapshot)>
pub fn largest_region(&self) -> Option<(&String, &RegionSnapshot)>
Get the largest region by current usage.
Sourcepub fn efficiency(&self) -> f64
pub fn efficiency(&self) -> f64
Calculate memory efficiency (deallocated / allocated).
Trait Implementations§
Source§impl Clone for MemoryReport
impl Clone for MemoryReport
Source§fn clone(&self) -> MemoryReport
fn clone(&self) -> MemoryReport
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 MemoryReport
impl Debug for MemoryReport
Source§impl<'de> Deserialize<'de> for MemoryReport
impl<'de> Deserialize<'de> for MemoryReport
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MemoryReport
impl RefUnwindSafe for MemoryReport
impl Send for MemoryReport
impl Sync for MemoryReport
impl Unpin for MemoryReport
impl UnsafeUnpin for MemoryReport
impl UnwindSafe for MemoryReport
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