Skip to main content

Stats

Struct Stats 

Source
pub struct Stats {
Show 16 fields pub reserved_bytes: u64, pub pinned_bytes: u64, pub committed_bytes: u64, pub committed_peak_bytes: u64, pub allocated_bytes: u64, pub allocated_peak_bytes: u64, pub purged_bytes: u64, pub purge_calls: u64, pub arena_purges: u64, pub mmap_calls: u64, pub commit_calls: u64, pub pages: u64, pub threads: u64, pub arenas: u64, pub huge_allocations: u64, pub huge_bytes: u64,
}
Expand description

Process-wide allocator statistics, excluding allocations that C libraries make through the system allocator.

Operating system accounting (reservations, commits, purges, mappings, arenas, threads) is current when read. Allocation counters (Self::allocated_bytes, Self::allocated_peak_bytes, Self::pages, Self::huge_allocations, Self::huge_bytes) are merged from each thread when it collects or exits, but a huge allocation is counted immediately.

Fields§

§reserved_bytes: u64

Bytes mimalloc has mapped from the operating system for its arenas, page map, and directly mapped pages. Pinned reservations are counted in Self::pinned_bytes instead.

§pinned_bytes: u64

Bytes of pinned reservations, which are never purged.

§committed_bytes: u64

Bytes currently committed, as mimalloc accounts them. On systems that overcommit, an eagerly committed on-demand arena counts as its slices are first used, while an unpinned Reserve counts in full and then again as its slices are first used. On Unix, a purge does not lower the figure.

§committed_peak_bytes: u64

Peak committed bytes.

§allocated_bytes: u64

Bytes currently allocated to callers, counted in block sizes (so including size-class rounding).

§allocated_peak_bytes: u64

Sum of the separately tracked peaks of normal and huge allocations, which can exceed their combined peak.

§purged_bytes: u64

Cumulative bytes purged back to the operating system.

§purge_calls: u64

Cumulative purge operations.

§arena_purges: u64

Cumulative arena-level purge passes.

§mmap_calls: u64

Cumulative memory mappings requested from the operating system.

§commit_calls: u64

Cumulative commit operations.

§pages: u64

Pages (mimalloc’s unit of size-class storage) currently in use.

§threads: u64

Threads currently known to the allocator.

§arenas: u64

Arenas currently managed.

§huge_allocations: u64

Cumulative allocations larger than the largest size class, each served by a page of its own.

§huge_bytes: u64

Cumulative bytes of those allocations.

Implementations§

Source§

impl Stats

Source

pub fn read() -> Option<Self>

Reads the current statistics, or None if the linked mimalloc’s statistics layout differs in size or version from the vendored header.

Trait Implementations§

Source§

impl Clone for Stats

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Stats

Source§

impl Debug for Stats

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Stats

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Stats

Source§

impl PartialEq for Stats

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Stats

Auto Trait Implementations§

§

impl Freeze for Stats

§

impl RefUnwindSafe for Stats

§

impl Send for Stats

§

impl Sync for Stats

§

impl Unpin for Stats

§

impl UnsafeUnpin for Stats

§

impl UnwindSafe for Stats

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.