pub struct MemoryBudgetConfig {
pub soft_limit_bytes: usize,
pub hard_limit_bytes: usize,
pub emergency_limit_bytes: usize,
}Expand description
Configuration for memory budget enforcement.
Fields§
§soft_limit_bytes: usizeSoft limit in bytes — triggers Warning alert and suggests degradation.
Default: 8 MiB (enough for ~524K cells at 16 bytes each, i.e. ~540×970).
hard_limit_bytes: usizeHard limit in bytes — triggers Critical alert with aggressive degradation.
Default: 16 MiB.
emergency_limit_bytes: usizeEmergency limit in bytes — triggers Emergency alert, drop frames.
Default: 32 MiB.
Implementations§
Source§impl MemoryBudgetConfig
impl MemoryBudgetConfig
Sourcepub fn normalized(self) -> Self
pub fn normalized(self) -> Self
Return a normalized copy with sane, monotone thresholds.
User-supplied configs (via ProgramConfig) can be zero-initialized
or inverted; the classifier uses >= comparisons, so an all-zero
config would classify EVERY frame as Emergency (blank screen from
startup) and inverted watermarks silently misclassify. Zero limits
fall back to the defaults; hard/emergency are raised to keep
soft <= hard <= emergency.
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 more