Files
6gbvram---16gb-ram/crates
theme613 f0d1eb7682 feat(residency): VICTORY_RAM_PRESSURE_MB gates heavy trims on physical RAM
Add residency::ram_critical(): when VICTORY_RAM_PRESSURE_MB=N>0 and sampled
physical available RAM < N MiB (hysteresis, enter <N, leave >N+256MiB), the
once-a-second host sweep also runs the fence-safe heavy trims + let_go_idle
sweeps that were previously gated only on critical_commit() (OS commit
headroom), which never fires on a 16 GB box with a large pagefile. Inert and
behavior-identical when the var is unset/0: no new sample or branch taken.
Rate-limited to the existing ~1 Hz sweep; logs one line (avail MB, freed MB,
host copies/textures alive). trim_idle keeps a tighter idle pool (24 vs 64)
under RAM pressure. All existing fence/ownership guards preserved.

Verified: cargo test -p victory-gpu --lib -j 4 (495 passed, 0 failed);
cargo build --profile diag -p victory --features diagnostics -j 4 (ok).
Asset policy: no new violation (only pre-existing .agents .diff + imgui.ini).
2026-12-01 00:12:49 +08:00
..