pub struct PolicyInput {
pub effective_target_bytes: u64,
pub rss_bytes: u64,
pub caches: Vec<CacheView>,
pub previous_cache_bytes: u64,
pub previous_cache_count: u32,
pub previous_rss_bytes: u64,
}Expand description
Inputs the policy needs to compute a new set of caps.
Fields§
§effective_target_bytes: u64Effective target after lease deductions, in bytes.
rss_bytes: u64Most recent RSS reading.
caches: Vec<CacheView>View of every registered cache, in registration order.
previous_cache_bytes: u64Sum of cache current_bytes at the previous tick, or 0
if this is the first tick (no history yet). The shrink
branch uses this to detect “RSS climbed but caches didn’t”
— a signal that the growth came from outside the cache
subsystem.
previous_cache_count: u32Number of registered caches at the previous tick. 0 on
first tick.
previous_rss_bytes: u64RSS reading at the previous tick. 0 on first tick.
The flat-caches guard requires RSS to have actually grown
(rss_bytes > previous_rss_bytes) so a lease-induced
effective-target drop — which raises the rss/target ratio
without an actual RSS climb — still triggers shrink.