Struct gc_arena::metrics::Pacing

source ·
pub struct Pacing { /* private fields */ }
Expand description

Tuning parameters for a given garbage collected crate::Arena.

Implementations§

source§

impl Pacing

source

pub fn with_pause_factor(self, pause_factor: f64) -> Pacing

The garbage collector will wait until the live size reaches <current heap size> + <previous retained size> * pause_multiplier before beginning a new collection. Must be >= 0.0, setting this to 0.0 causes the collector to never sleep longer than min_sleep before beginning a new collection.

source

pub fn with_timing_factor(self, timing_factor: f64) -> Pacing

The garbage collector will try and finish a collection by the time <current heap size> * timing_factor additional bytes are allocated. For example, if the collection is started when the arena has 100KB live data, and the timing_multiplier is 1.0, the collector should finish its final phase of this collection after another 100KB has been allocated. Must be >= 0.0, setting this to 0.0 causes the collector to behave like a stop-the-world collector.

source

pub fn with_min_sleep(self, min_sleep: usize) -> Pacing

The minimum allocation amount during sleep before the arena starts collecting again. This is mostly useful when the heap is very small to prevent rapidly restarting collections.

Trait Implementations§

source§

impl Clone for Pacing

source§

fn clone(&self) -> Pacing

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Pacing

source§

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

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

impl Default for Pacing

Creates a default Pacing with pause_factor set to 0.5, timing_factor set to 1.5, and min_sleep set to 4096.

source§

fn default() -> Pacing

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

impl Copy for Pacing

Auto Trait Implementations§

§

impl Freeze for Pacing

§

impl RefUnwindSafe for Pacing

§

impl Send for Pacing

§

impl Sync for Pacing

§

impl Unpin for Pacing

§

impl UnwindSafe for Pacing

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> 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,

§

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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.