#[non_exhaustive]pub struct HeapSnapshot {
pub frame: u32,
pub live_bytes: u64,
pub peak_bytes: u64,
pub tags: Vec<TagRow>,
pub overflowed: u32,
}Expand description
What holds the heap at a frame (ADR-0046 §6): its live bytes, and each
memory tag’s counts. Build it with HeapSnapshot::new (ADR-0039),
which puts the rows in order; compare two with diff.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.frame: u32The frame it was taken after (frames count from 1; 0 is before the first).
live_bytes: u64The bytes allocated and not yet freed.
peak_bytes: u64The most bytes live at once since the program started.
Each tag with bytes live or ever allocated under it: the most live bytes first, then by class, then by name.
overflowed: u32How many names had no tag of their own, past the counter’s table,
and count under overflow.
Implementations§
Source§impl HeapSnapshot
impl HeapSnapshot
Sourcepub fn new(live_bytes: u64, peak_bytes: u64, tags: Vec<TagRow>) -> Self
pub fn new(live_bytes: u64, peak_bytes: u64, tags: Vec<TagRow>) -> Self
A snapshot of frame 0 with live_bytes live, peak_bytes at the
most, and the rows tags, put in order: the most live bytes first,
then by class, then by name. None overflowed.
Sourcepub fn diff(&self, later: &HeapSnapshot) -> HeapDiff
pub fn diff(&self, later: &HeapSnapshot) -> HeapDiff
What changed from this snapshot to later: the tags whose live
bytes or blocks changed, a tag missing from one counting as 0
there.
Trait Implementations§
Source§impl Clone for HeapSnapshot
impl Clone for HeapSnapshot
Source§fn clone(&self) -> HeapSnapshot
fn clone(&self) -> HeapSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HeapSnapshot
impl Debug for HeapSnapshot
Source§impl Default for HeapSnapshot
impl Default for HeapSnapshot
Source§fn default() -> HeapSnapshot
fn default() -> HeapSnapshot
Source§impl<'de> Deserialize<'de> for HeapSnapshot
impl<'de> Deserialize<'de> for HeapSnapshot
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>,
impl Eq for HeapSnapshot
Source§impl JsonSchema for HeapSnapshot
impl JsonSchema for HeapSnapshot
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more