pub struct MemoryBudgetConfig {
pub receipt_mirror_capacity: usize,
pub federation_cache_capacity: usize,
pub federation_cache_idle_ttl_secs: u64,
pub velocity_bucket_cap: usize,
pub admission_key_cap: usize,
pub journal_entry_cap: usize,
pub max_stream_chunks: u64,
pub journal_tool_counts_cap: usize,
pub rss_soft_limit_bytes: Option<u64>,
pub rss_sample_interval_secs: u64,
}Expand description
Per-process memory budget: bounded-structure capacities plus a process RSS soft ceiling. The soft ceiling is the in-process analog of the cgroup hard limit: the kernel sheds (Overloaded) before the OS OOM-kills it.
Fields§
§receipt_mirror_capacity: usize§federation_cache_capacity: usize§federation_cache_idle_ttl_secs: u64§velocity_bucket_cap: usize§admission_key_cap: usize§journal_entry_cap: usize§max_stream_chunks: u64Max number of chunks retained from one streamed tool result. Bounds the
retained Vec<ToolCallChunk> and the per-chunk signing preimage so a flood
of tiny chunks that never trips max_stream_total_bytes still cannot grow
memory without bound. 0 disables the cap.
journal_tool_counts_cap: usizeMax number of DISTINCT tool names retained in each session journal’s
cumulative tool_counts map. Unlike the entries and
tool_sequence rings, tool_counts is cumulative (it survives ring
eviction so the behavioral-sequence guard can answer “was this tool ever
invoked”), so a ring cannot bound it. Once a session reaches this many
distinct tool names a previously-unseen name is dropped fail-closed: a
dependent required-predecessor check then treats it as never-invoked and
denies. Sized well above any legitimate (registry-bounded) tool set.
rss_soft_limit_bytes: Option<u64>Process RSS soft ceiling in bytes. When set and exceeded, new admissions shed with Overloaded { Allocation }. Set to roughly 85-90% of the cgroup memory.max so the graceful stop fires before the kill. Stage A ships None.
rss_sample_interval_secs: u64How often the RSS sampler reads /proc/self/statm.
Implementations§
Trait Implementations§
Source§impl Clone for MemoryBudgetConfig
impl Clone for MemoryBudgetConfig
Source§fn clone(&self) -> MemoryBudgetConfig
fn clone(&self) -> MemoryBudgetConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MemoryBudgetConfig
impl Debug for MemoryBudgetConfig
Auto Trait Implementations§
impl Freeze for MemoryBudgetConfig
impl RefUnwindSafe for MemoryBudgetConfig
impl Send for MemoryBudgetConfig
impl Sync for MemoryBudgetConfig
impl Unpin for MemoryBudgetConfig
impl UnsafeUnpin for MemoryBudgetConfig
impl UnwindSafe for MemoryBudgetConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more