pub struct Pacing { /* private fields */ }
Expand description
Tuning parameters for a given garbage collected crate::Arena
.
Implementations§
source§impl Pacing
impl Pacing
sourcepub fn with_pause_factor(self, pause_factor: f64) -> Pacing
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.
sourcepub fn with_timing_factor(self, timing_factor: f64) -> Pacing
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.
sourcepub fn with_min_sleep(self, min_sleep: usize) -> Pacing
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 Default for Pacing
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.