gpu: trim the title's working set under RAM pressure (VICTORY_TRIM_BELOW_MB) #113
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ReTerryDavis--ReVIctory!113
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-112"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@SovietBearz0r on GitHub · 2026-12-05 12:40 UTC · original
SovietBearz0r:minivi-workingset-trim→main· +533 −2 · 5 files · 1 commits · closed without mergingTrim the title's own working set under RAM pressure:
VICTORY_TRIM_BELOW_MB.What
New
crates/victory-gpu/src/trim.rs: a background thread, armed only when available physical memory drops below the threshold (VICTORY_TRIM_BELOW_MB; unset = 1536 MiB, auto-on for hosts with <= 20 GiB RAM, off above;0disables), trims only title-private committed memory — never images, mapped sections, other private memory, guard pages or write-combined ranges, never in-place heaps — in gentle 16 MiB pacedVirtualUnlockchunks (orK32EmptyWorkingSetwithVICTORY_TRIM_GENTLE=0), with TOCTOU re-verification and 30 s/growth gating. Wired intowatch::title_memory_allocated/freed, the write-combined range journal,inplace::open(read-exclusion guard) andresidency::refresh(thread start).Verification
cargo test -p victory-gpu --lib: 716 passed (4 new: threshold parsing, pacing, region classification, in-place/WC subtraction); normal and diagnostics builds compile.cargo check -p victory,cargo xtask policy, clippy: clean.Source: Androtim/MiniVI
dc8197ef(+554,trim.rs), adapted to this tree's residency/watch/inplace hooks.@ReTerryDavis on GitHub · 2026-12-05 17:37 UTC · original
Closing this one —
VICTORY_TRIM_BELOW_MBis auto-ON on<= 20 GiBRAM hosts despite no in-game testing on a constrained-RAM machine, re-introduces working-set trimming (VirtualUnlock/K32EmptyWorkingSet) right after8746753reverted that approach, and has OFF-path issues:watch.rs:584):title_memory_write_combinedalways locksWRITE_COMBINED_RANGESand pushes(at, end)forever without pruning ontitle_memory_freed, even on> 20 GiBhosts where trimming never runs.trim_gentlyholdsOPEN_LOCK.read()acrossVirtualQuery+ 16 MiBVirtualUnlocksyscalls, blockinginplace::open's write lock, andinplace.rsskipsFrom::Section(_)heaps.@SovietBearz0r on GitHub · 2026-12-05 18:27 UTC · original
Review addressed and resubmitted as #160 (I can't reopen this one: GitHub doesn't let the author reopen a PR closed by the maintainer). The new PR is rebased on current main and its body lists point-by-point what changed; closed this thread is fine, please use the new one.
Pull request closed