pub struct MemoryBudget {
pub warning_threshold_bytes: usize,
pub critical_threshold_bytes: usize,
pub ast_cache_max_bytes: usize,
}Expand description
Memory budget configuration for OOM protection.
Thresholds are approximate: the server tracks explicitly allocated memory rather than querying the OS. Actual RSS is typically 1.5–3x higher.
Fields§
§warning_threshold_bytes: usizeByte count at which the server enters warning mode (default: 512 MB).
critical_threshold_bytes: usizeByte count at which the server enters critical mode (default: 1 GB).
ast_cache_max_bytes: usizeMaximum total bytes in the AST cache (default: 128 MB).
Implementations§
Source§impl MemoryBudget
impl MemoryBudget
Sourcepub fn constrained() -> MemoryBudget
pub fn constrained() -> MemoryBudget
Budget for resource-constrained environments (low-RAM containers).
Sourcepub fn large_workspace() -> MemoryBudget
pub fn large_workspace() -> MemoryBudget
Budget for large workspaces on developer machines with ample RAM.
Trait Implementations§
Source§impl Clone for MemoryBudget
impl Clone for MemoryBudget
Source§fn clone(&self) -> MemoryBudget
fn clone(&self) -> MemoryBudget
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MemoryBudget
Source§impl Debug for MemoryBudget
impl Debug for MemoryBudget
Source§impl Default for MemoryBudget
impl Default for MemoryBudget
Source§fn default() -> MemoryBudget
fn default() -> MemoryBudget
Returns the “default value” for a type. Read more
impl Eq for MemoryBudget
Source§impl PartialEq for MemoryBudget
impl PartialEq for MemoryBudget
Source§fn eq(&self, other: &MemoryBudget) -> bool
fn eq(&self, other: &MemoryBudget) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MemoryBudget
Auto Trait Implementations§
impl Freeze for MemoryBudget
impl RefUnwindSafe for MemoryBudget
impl Send for MemoryBudget
impl Sync for MemoryBudget
impl Unpin for MemoryBudget
impl UnsafeUnpin for MemoryBudget
impl UnwindSafe for MemoryBudget
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.