VICTORY_KEEP_RAM_GB: keep the game's memory in RAM on 32 GB PCs #568

Manually merged
github merged 1 commit from github-bot/gh-568 into main 2026-11-29 08:22:08 +00:00 AGit
Owner

@⁠arminkhaleghirod on GitHub · 2026-11-28 01:02 UTC · original
arminkhaleghirod:keep-ram → main · +37 −0 · 1 files · 1 commits · merged 2026-11-29 08:16 UTC

On my PC (32 GB RAM, RTX 4080) the game commits about 28 GB. Once free RAM ran low, Windows trimmed the game's working set from 15 GB to 2 GB at once, and it ran at half speed (22 fps down to 5-10) for minutes while it read its memory back from the page file. It kept happening, even in loading screens.

VICTORY_KEEP_RAM_GB= sets a hard minimum working set of n GB at start (SetProcessWorkingSetSizeEx with QUOTA_LIMITS_HARDWS_MIN_ENABLE), so Windows pages out other programs instead. With 14 the game stayed at 21-23 GB in RAM for a whole session and the slowdowns were gone. If Windows refuses the size, it says so and runs without it. Unset, nothing changes.

**@⁠arminkhaleghirod** on GitHub · 2026-11-28 01:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/568) `arminkhaleghirod:keep-ram` → `main` · +37 −0 · 1 files · 1 commits · merged 2026-11-29 08:16 UTC On my PC (32 GB RAM, RTX 4080) the game commits about 28 GB. Once free RAM ran low, Windows trimmed the game's working set from 15 GB to 2 GB at once, and it ran at half speed (22 fps down to 5-10) for minutes while it read its memory back from the page file. It kept happening, even in loading screens. VICTORY_KEEP_RAM_GB=<n> sets a hard minimum working set of n GB at start (SetProcessWorkingSetSizeEx with QUOTA_LIMITS_HARDWS_MIN_ENABLE), so Windows pages out other programs instead. With 14 the game stayed at 21-23 GB in RAM for a whole session and the slowdowns were gone. If Windows refuses the size, it says so and runs without it. Unset, nothing changes.
On a 32 GB PC the game commits about 28 GB. When free memory ran out,
Windows cut the process's working set from 15 GB to 2 GB in one go and
the game ran at half speed for minutes while it faulted its memory back
in from the page file. A hard minimum (QUOTA_LIMITS_HARDWS_MIN_ENABLE)
makes Windows page out other programs instead. Unset, nothing changes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 01:06:56 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-28 20:44 UTC · original

Tested the same call from outside the process, because the script launcher (victory run) doesn't go through play.rs's prepare(). A helper calls SetProcessWorkingSetSizeEx(min 14 GB, max 28 GB, HARDWS_MIN_ENABLE | HARDWS_MAX_DISABLE) on victory.exe once its window appears. System: RTX 5070 Ti 16 GB (driver 621.40), Ryzen 7 9800X3D (SMT on, 16 threads), 32 GB DDR5, Windows 11 build 26300, pagefile C: 32–64 GB (custom). Title 1.0.2.1. Script launcher, mode 6, Series X, DLSS + DLSS frame generation 4x. Built from source..

  • Windows accepted it for both processes of a start (the first start's restart included) (MEASURED).
  • Working set in RAM: ~15–16 GB without it, 19.0–19.3 GB with it, private 25–26 GB, PC free RAM 1.1–1.5 GB (MEASURED, 3 samples over ~8 min).
  • Rendered fps over the same stretch: median 23.9 in the first 3 minutes, 16.9 in a heavier area (MEASURED). There's no clean A/B in the same scene yet, so I can't claim a speed change (ASSUMED: needs a longer run).

Note for the PR: as written it only applies to victory play. Users on the script launcher (play-foxhound.ps1 → victory run) don't get it. Calling keep_ram() from run too would cover them.

**@⁠futurepro62** on GitHub · 2026-11-28 20:44 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/568#issuecomment-7245509333) Tested the same call from outside the process, because the script launcher (`victory run`) doesn't go through `play.rs`'s `prepare()`. A helper calls `SetProcessWorkingSetSizeEx(min 14 GB, max 28 GB, HARDWS_MIN_ENABLE | HARDWS_MAX_DISABLE)` on `victory.exe` once its window appears. System: RTX 5070 Ti 16 GB (driver 621.40), Ryzen 7 9800X3D (SMT on, 16 threads), 32 GB DDR5, Windows 11 build 26300, pagefile C: 32–64 GB (custom). Title 1.0.2.1. Script launcher, mode 6, Series X, DLSS + DLSS frame generation 4x. Built from source.. - Windows accepted it for both processes of a start (the first start's restart included) (MEASURED). - Working set in RAM: ~15–16 GB without it, **19.0–19.3 GB** with it, private 25–26 GB, PC free RAM 1.1–1.5 GB (MEASURED, 3 samples over ~8 min). - Rendered fps over the same stretch: median 23.9 in the first 3 minutes, 16.9 in a heavier area (MEASURED). There's no clean A/B in the same scene yet, so I can't claim a speed change (ASSUMED: needs a longer run). Note for the PR: as written it only applies to `victory play`. Users on the script launcher (`play-foxhound.ps1` → `victory run`) don't get it. Calling `keep_ram()` from `run` too would cover them.
github manually merged commit d9fae4e985 into main 2026-11-29 08:22:08 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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/trustno1-coder--VIctory-NVIDIA!568
No description provided.