pub struct Pool { /* private fields */ }Expand description
A shared byte budget that caches charge into; cloning shares the same budget.
The pool tracks how many payload bytes are cached across every registered group, plus the mean last-access time of the evictable ones. It never evicts on its own: tracks accrue eviction debt as they write and evict their own oldest groups to pay it, so every operation here is a few atomics with no lock. The capacity is therefore a target usage converges toward, not a hard limit: carried debt, capped payments, and the always-protected live edge all let usage transiently exceed it.
Implementations§
Source§impl Pool
impl Pool
Sourcepub fn new(capacity: u64) -> Self
pub fn new(capacity: u64) -> Self
Create a pool with a byte target that tracks evict toward as they write.
The budget counts frame payload bytes (plus a small fixed overhead per group), not process RSS, and is a convergence target rather than a hard limit; leave headroom when sizing it from real memory.