Struct jemalloc_ctl::stats::Retained[][src]

pub struct Retained(_);

A type providing access to the total number of bytes in virtual memory mappings that were retained rather than being returned to the operating system via e.g. munmap(2).

Retained virtual memory is typically untouched, decommitted, or purged, so it has no strongly associated physical memory. Retained memory is excluded from mapped memory statistics, e.g. Mapped.

This statistic is cached, and is only refreshed when the epoch is advanced. See the Epoch type for more information.

This corresponds to stats.retained in jemalloc's API.

Examples

extern crate jemallocator;
extern crate jemalloc_ctl;

use jemalloc_ctl::Epoch;
use jemalloc_ctl::stats::Retained;

#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

fn main() {
    let epoch = Epoch::new().unwrap();
    let retained = Retained::new().unwrap();

    epoch.advance().unwrap();
    let size = retained.get().unwrap();
    println!("{} bytes of total retained data", size);
}

Methods

impl Retained
[src]

Returns a new Retained.

Returns the total number of bytes in virtual memory mappings that were retained.

Trait Implementations

impl Copy for Retained
[src]

impl Clone for Retained
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Retained

impl Sync for Retained