pub struct MemorySnapshot {
pub timestamp: u64,
pub stats: MemoryStats,
pub active_allocations: HashMap<usize, ActiveAllocation>,
pub thread_stats: HashMap<u64, ThreadMemoryStats>,
}Expand description
Memory snapshot - a point-in-time view of memory usage
Fields§
§timestamp: u64Timestamp when this snapshot was taken
stats: MemoryStatsOverall memory statistics
active_allocations: HashMap<usize, ActiveAllocation>Active allocations (ptr -> allocation info)
thread_stats: HashMap<u64, ThreadMemoryStats>Per-thread statistics
Implementations§
Source§impl MemorySnapshot
impl MemorySnapshot
Sourcepub fn from_allocation_infos(allocations: Vec<AllocationInfo>) -> Self
pub fn from_allocation_infos(allocations: Vec<AllocationInfo>) -> Self
Build a MemorySnapshot from a list of AllocationInfo (capture module type)
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Get the number of active allocations
Sourcepub fn current_memory(&self) -> usize
pub fn current_memory(&self) -> usize
Get the current memory usage
Sourcepub fn peak_memory(&self) -> usize
pub fn peak_memory(&self) -> usize
Get the peak memory usage
Trait Implementations§
Source§impl Clone for MemorySnapshot
impl Clone for MemorySnapshot
Source§fn clone(&self) -> MemorySnapshot
fn clone(&self) -> MemorySnapshot
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 MemorySnapshot
impl Debug for MemorySnapshot
Source§impl Default for MemorySnapshot
impl Default for MemorySnapshot
Source§fn default() -> MemorySnapshot
fn default() -> MemorySnapshot
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for MemorySnapshot
impl<'de> Deserialize<'de> for MemorySnapshot
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 MemorySnapshot
impl RefUnwindSafe for MemorySnapshot
impl Send for MemorySnapshot
impl Sync for MemorySnapshot
impl Unpin for MemorySnapshot
impl UnsafeUnpin for MemorySnapshot
impl UnwindSafe for MemorySnapshot
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