Memory policy: VICTORY_KEEP_FREED keeps freed copies 300 s while 12 GB of RAM is free, whatever the process size #234

Open
opened 2026-11-26 12:16:00 +00:00 by github-bot · 0 comments
Owner

@⁠kekonn on GitHub · 2026-11-26 12:13 UTC · original

crates/victory-gpu/src/host.rs:389-412: keep_freed() is on unless VICTORY_KEEP_FREED=0. While at least 12 GiB of physical RAM is free (avail_phys >= 12 * GIB), the idle lifetime is KEPT_MS = 300 s. That covers window copies (shadow.rs ~2995), texture staging (texture.rs ~525) and the pipeline library trim (pipeline/library.rs ~379).

The threshold is the PC's free RAM, not this process's size. On a 64 GB PC the process can grow to about 50 GB before anything is let go sooner. With VICTORY_RESIDENCY off (the default), commit headroom is not considered.

An audit found no single unbounded leak large enough to explain the 35-46 GB of private memory the README reports. Retention like this, plus the capped pools (spare scratch 1 GiB, send.rs 768 MiB, snapshots 512 MiB, idle lists 256 MiB, staging 8×64 MiB), is the likely bulk. The placed-view shape growth fixed by #206 is the exception.

Not a quick change. This trades memory against device-loss risk, so it needs measurement on real hardware. Options that reuse tested helpers:

  • In shadow::let_go_idle, always compute the RAM band from ram_sample() (private vs commit limit, with hysteresis; host.rs ~442-483), and apply the idle-time clamp even when no window budget is set.
  • Or require private*10 < commit_limit*7 before ram_idle_ms returns KEPT_MS.

A quick test: run once with VICTORY_KEEP_FREED=0 and compare private bytes and frame times.

Related:

  • #189, #146, #75 and #65 report memory exhaustion on 16-32 GB PCs.
  • PRs #92 (relief after out-of-memory), #205 (VM decommit and trimming), #206 (second commit: 5 s idle textures under pressure) and #180 work in this area.

Generated by Claude Code

**@⁠kekonn** on GitHub · 2026-11-26 12:13 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/issues/234) `crates/victory-gpu/src/host.rs:389-412`: `keep_freed()` is on unless `VICTORY_KEEP_FREED=0`. While at least 12 GiB of physical RAM is free (`avail_phys >= 12 * GIB`), the idle lifetime is `KEPT_MS` = 300 s. That covers window copies (`shadow.rs` ~2995), texture staging (`texture.rs` ~525) and the pipeline library trim (`pipeline/library.rs` ~379). The threshold is the PC's *free* RAM, not this process's size. On a 64 GB PC the process can grow to about 50 GB before anything is let go sooner. With `VICTORY_RESIDENCY` off (the default), commit headroom is not considered. An audit found no single unbounded leak large enough to explain the 35-46 GB of private memory the README reports. Retention like this, plus the capped pools (spare scratch 1 GiB, `send.rs` 768 MiB, snapshots 512 MiB, idle lists 256 MiB, staging 8×64 MiB), is the likely bulk. The placed-view shape growth fixed by #206 is the exception. **Not a quick change.** This trades memory against device-loss risk, so it needs measurement on real hardware. Options that reuse tested helpers: - In `shadow::let_go_idle`, always compute the RAM band from `ram_sample()` (private vs commit limit, with hysteresis; `host.rs` ~442-483), and apply the idle-time clamp even when no window budget is set. - Or require `private*10 < commit_limit*7` before `ram_idle_ms` returns `KEPT_MS`. A quick test: run once with `VICTORY_KEEP_FREED=0` and compare private bytes and frame times. **Related:** - #189, #146, #75 and #65 report memory exhaustion on 16-32 GB PCs. - PRs #92 (relief after out-of-memory), #205 (VM decommit and trimming), #206 (second commit: 5 s idle textures under pressure) and #180 work in this area. --- _Generated by [Claude Code](https://claude.ai/code)_
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 12:16:00 +00:00
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/avatarmanz--VIctory-7900XTX#234
No description provided.