Play: the kept RAM's hard minimum is let go before the PC runs out #2638
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2638
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@unueberlegt on GitHub · 2026-11-29 15:21 UTC · original
unueberlegt:fix/keep-ram-self-disarm→main· +128 −5 · 1 files · 4 commits · openWhat 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
@dyshay on GitHub · 2026-11-29 15:40 UTC · original
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.@tyr0nsur on GitHub · 2026-11-30 08:34 UTC · original
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.@unueberlegt on GitHub · 2026-12-01 08:42 UTC · original
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
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.