vtcode_config/constants/memory.rs
1/// Soft memory limit in bytes (400 MB) - triggers warning and TTL reduction
2pub const SOFT_LIMIT_BYTES: usize = 400 * 1024 * 1024;
3
4/// Hard memory limit in bytes (600 MB) - triggers aggressive eviction
5pub const HARD_LIMIT_BYTES: usize = 600 * 1024 * 1024;
6
7/// Memory check interval in milliseconds (100 ms)
8pub const CHECK_INTERVAL_MS: u64 = 100;
9
10/// TTL reduction factor under warning pressure (reduce from 5min to 2min)
11pub const WARNING_TTL_REDUCTION_FACTOR: f64 = 0.4;
12
13/// TTL reduction factor under critical pressure (reduce from 5min to 30s)
14pub const CRITICAL_TTL_REDUCTION_FACTOR: f64 = 0.1;
15
16/// Minimum RSA size to track in checkpoints (1 MB)
17/// Minimum RSS size to track in checkpoints (1 MiB)
18pub const MIN_RSS_CHECKPOINT_BYTES: usize = 1024 * 1024;
19
20/// Maximum memory checkpoint history to keep
21pub const MAX_CHECKPOINT_HISTORY: usize = 100;
22
23/// Default threshold for memory pressure report (MB)
24pub const DEFAULT_REPORT_THRESHOLD_MB: usize = 50;