Play: the kept RAM's hard minimum is let go before the PC runs out #2638
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2638"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by unueberlegt on 2026-11-29T15:21:33Z.
What this changes
VICTORY_KEEP_RAM_GB's hard working-set minimum keeps its guarantee, but:QUOTA_LIMITS_HARDWS_MAX_DISABLEis no longer set): under pressure the memory manager may trim the set back to it, where before the process could claim the whole PC;Why
The hard minimum is held even as the game's commit grows past what the PC can hold. Measured on an RTX 5070 12 GB / 31 GB PC, Series X, 1440p, DLSS Quality, FG 2× (#2464's §3): with 20 GB kept, the PC fell to 980 MB free, 202 host allocations were refused (
0x8007000E), and the game died 4 minutes 49 seconds in — reading through a NULL pointer in VCRUNTIME140's copy loop, called from its own code, its crash handler taking the process down. The same run without the switch survives the same exhaustion as a zombie at 3 fps with 297 refused allocations: the difference the minimum makes is that nothing can be given back, so a failing allocation fails fatally in code that (a console title) has no out-of-memory path. #2464's reporter lost the device instead of the title — their 32 GB of page file kept the host's allocations alive, and the pressure landed on the card's residency.The switch's own case (Windows cutting the working set from 15 GB to 2 GB at once, the game at half speed for minutes) is untouched: the minimum is kept as long as the PC can spare it.
Testing
the_hard_minimum_is_let_go_when_the_pc_runs_out: the threshold's edges.Part of #2464 (its §3; §2 — the PC exhausting without the switch — is measured and reported there: 48 GB committed, ~300 refusals, 3 fps on this PC).
🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T15:40:03Z.
Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch
janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with--profile diag --features diagnostics, and the CPU tests of the touched crates pass. Runs on an RTX 4090 are queued (Series X 1440p, and Series S with ray tracing, DLSS Quality). Frame times will follow here.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-11-30T08:34:57Z.
I reproduced two Win32 failures in the working-set setup and disarm paths of this PR.
min = max = 256 MiBand flag0x1,SetProcessWorkingSetSizeExreturnedERROR_INVALID_PARAMETER(87). The hard minimum was never installed on this machine.0x4 | 0x8also returned 87 and the reported flags stayed0x9. Those two bits control the maximum in opposite directions.Follow-up commit
0358b98, based onb82884e, keeps distinct sizes and uses onlyQUOTA_LIMITS_HARDWS_MIN_DISABLE(0x2). In the same Windows probe, the corrected call succeeded, flags changed from0x9to0xA, and the guard proposed on #3749 detected the release. The watcher now reports a failed call and retries at the next low-RAM sample. The existing threshold test and staged asset-policy check passed. The API probe ran in a disposable process without the title.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by unueberlegt on 2026-12-01T08:42:10Z.
Thanks for the reproduction and for pinning both failures down — the analysis was exactly right, and the fix is now on the branch.
Your
0358b98is cherry-picked ontofix/keep-ram-self-disarm(authorship kept): distinct sizes on install and release (max = min * 2), onlyQUOTA_LIMITS_HARDWS_MIN_ENABLEon the way in andQUOTA_LIMITS_HARDWS_MIN_DISABLEon the way out, and a failed release is now logged and retried at the next low-RAM sample instead of silently ending the watch. The branch also carries a merge of current main, so it is MERGEABLE again.@dyshay, one note for the
janus-prsruns: they exercised the pre-fix form. Depending on the machine, either the hard minimum never installed (ERROR_INVALID_PARAMETERwith equal sizes, so the run measured effectively no switch), or it installed and the broken disarm flags left it hard for the rest of the run — the case this PR exists for. If the queued RTX 4090 runs have not happened yet, a re-run against the updated branch would measure the switch as it is meant to work.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.