pub struct MemorySnapshot {
pub rss_bytes: usize,
pub vms_bytes: usize,
}Expand description
A snapshot of memory usage at a point in time.
Fields§
§rss_bytes: usizeResident set size in bytes (physical memory used).
vms_bytes: usizeVirtual memory size in bytes.
Implementations§
Source§impl MemorySnapshot
impl MemorySnapshot
Sourcepub fn current() -> Self
pub fn current() -> Self
Take a snapshot of current process memory usage.
On Linux, reads /proc/self/status for VmRSS and VmSize.
On other platforms, returns zero values.
Sourcepub fn rss_display(&self) -> String
pub fn rss_display(&self) -> String
Returns RSS formatted as a human-readable string.
Sourcepub fn vms_display(&self) -> String
pub fn vms_display(&self) -> String
Returns VMS formatted as a human-readable string.
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 Display for MemorySnapshot
impl Display for MemorySnapshot
Source§impl PartialEq for MemorySnapshot
impl PartialEq for MemorySnapshot
impl Copy for MemorySnapshot
impl Eq for MemorySnapshot
impl StructuralPartialEq for MemorySnapshot
Auto Trait Implementations§
impl Freeze for MemorySnapshot
impl RefUnwindSafe for MemorySnapshot
impl Send for MemorySnapshot
impl Sync for MemorySnapshot
impl Unpin 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: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).