pub struct MemoryProfiler { /* private fields */ }Expand description
Memory profiler that tracks allocations and deallocations.
Implementations§
Source§impl MemoryProfiler
impl MemoryProfiler
Sourcepub fn record_allocation(&self, size_bytes: u64, source: String) -> usize
pub fn record_allocation(&self, size_bytes: u64, source: String) -> usize
Record a tensor allocation.
Sourcepub fn record_deallocation(&self, id: usize)
pub fn record_deallocation(&self, id: usize)
Record a tensor deallocation.
Sourcepub fn current_usage(&self) -> u64
pub fn current_usage(&self) -> u64
Get current memory usage in bytes.
Sourcepub fn peak_usage(&self) -> u64
pub fn peak_usage(&self) -> u64
Get peak memory usage in bytes.
Sourcepub fn get_stats(&self) -> MemoryStats
pub fn get_stats(&self) -> MemoryStats
Get memory usage statistics.
Sourcepub fn get_allocations(&self) -> Vec<AllocationRecord>
pub fn get_allocations(&self) -> Vec<AllocationRecord>
Get all allocation records.
Sourcepub fn get_active_allocations(&self) -> Vec<AllocationRecord>
pub fn get_active_allocations(&self) -> Vec<AllocationRecord>
Get active (not yet deallocated) allocations.
Sourcepub fn export_timeline(&self) -> String
pub fn export_timeline(&self) -> String
Export memory timeline to CSV.
Trait Implementations§
Source§impl Clone for MemoryProfiler
impl Clone for MemoryProfiler
Source§fn clone(&self) -> MemoryProfiler
fn clone(&self) -> MemoryProfiler
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 moreAuto Trait Implementations§
impl Freeze for MemoryProfiler
impl RefUnwindSafe for MemoryProfiler
impl Send for MemoryProfiler
impl Sync for MemoryProfiler
impl Unpin for MemoryProfiler
impl UnwindSafe for MemoryProfiler
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