pub struct MemoryReclaimOnThreshold<const D: usize, V: Variant, R: MemoryReclaimer<V>> { /* private fields */ }
Expand description
Memory reclaim policy which triggers the reclaim operation whenever the node utilization falls below a certain threshold.
Specifically, memory of closed nodes will be reclaimed whenever the ratio of closed nodes to all nodes exceeds one over 2^D
.
- when
D = 0
: memory will be reclaimed when utilization is below 0.00% (equivalent to never). - when
D = 1
: memory will be reclaimed when utilization is below 50.00%. - when
D = 2
: memory will be reclaimed when utilization is below 75.00%. - when
D = 3
: memory will be reclaimed when utilization is below 87.50%. - when
D = 4
: memory will be reclaimed when utilization is below 93.75%.
Implementations§
Source§impl<const D: usize, V: Variant, R: MemoryReclaimer<V>> MemoryReclaimOnThreshold<D, V, R>
impl<const D: usize, V: Variant, R: MemoryReclaimer<V>> MemoryReclaimOnThreshold<D, V, R>
Sourcepub fn col_needs_memory_reclaim<P>(col: &SelfRefCol<V, Self, P>) -> bool
pub fn col_needs_memory_reclaim<P>(col: &SelfRefCol<V, Self, P>) -> bool
Returns whether or not the collection col
requires to reclaim memory; i.e.,
whether or not the utilization is below the constant threshold.
Trait Implementations§
Source§impl<const D: usize, V: Variant, R: MemoryReclaimer<V>> Clone for MemoryReclaimOnThreshold<D, V, R>
impl<const D: usize, V: Variant, R: MemoryReclaimer<V>> Clone for MemoryReclaimOnThreshold<D, V, R>
Source§impl<const D: usize, V: Variant, R: MemoryReclaimer<V>> Default for MemoryReclaimOnThreshold<D, V, R>
impl<const D: usize, V: Variant, R: MemoryReclaimer<V>> Default for MemoryReclaimOnThreshold<D, V, R>
Source§impl<const D: usize, V, R> MemoryPolicy<V> for MemoryReclaimOnThreshold<D, V, R>where
V: Variant,
R: MemoryReclaimer<V>,
impl<const D: usize, V, R> MemoryPolicy<V> for MemoryReclaimOnThreshold<D, V, R>where
V: Variant,
R: MemoryReclaimer<V>,
Auto Trait Implementations§
impl<const D: usize, V, R> Freeze for MemoryReclaimOnThreshold<D, V, R>
impl<const D: usize, V, R> RefUnwindSafe for MemoryReclaimOnThreshold<D, V, R>where
V: RefUnwindSafe,
R: RefUnwindSafe,
impl<const D: usize, V, R> Send for MemoryReclaimOnThreshold<D, V, R>
impl<const D: usize, V, R> Sync for MemoryReclaimOnThreshold<D, V, R>
impl<const D: usize, V, R> Unpin for MemoryReclaimOnThreshold<D, V, R>
impl<const D: usize, V, R> UnwindSafe for MemoryReclaimOnThreshold<D, V, R>where
V: UnwindSafe,
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more