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]
impl Retainedpub fn new() -> Result<Retained>[src]
pub fn new() -> Result<Retained>Returns a new Retained.
pub fn get(&self) -> Result<usize>[src]
pub fn get(&self) -> Result<usize>Returns the total number of bytes in virtual memory mappings that were retained.