XMem: VICTORY_TITLE_MEMORY=own tells the title its own memory, not the process commit (#4547) #4611
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!4611
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4610"
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?
@davemathews12 on GitHub · 2026-11-30 23:46 UTC · original
davemathews12:fix/title-memory-own→main· +1031 −853 · 33 files · 14 commits · closed without mergingFixes # (none: helps #4548)
What it changes
Adds
VICTORY_TITLE_MEMORY=own, off by default. With it, the title is told how much memory it uses, instead of how much the whole process has committed.Why:
GlobalMemoryStatusExandXMemGetWorkingSetStatistics(xmem.rs,title_memory()) answer "used" with the process'sPagefileUsage. That includes the layer's own memory: host copies of title memory, translated shaders and the card's driver. The limit is the console's budget, so a few minutes in, the title reads 0 MB available, load 100. The code already says so in two comments ("in a long run nothing may read as available"; "A title that budgets its streaming from these two figures believes it is far over its limit").#4548 shows it happening. On Series S the limit is 7,776 MB, the process had 29,750 MB committed, and the title's own status said
available_mb=0 load=100. The game's crash context says the title itself held about 1.27 GB. Then came a null read (+0x3de915c, 3/3 runs) as the safehouse task prestreamed its next step.What "own" counts (
procmem::title_own):XMemAllocatePhysicalPages), at their reserved size. Each physical page counts once, however many views show it, which is why the views at console addresses are not added;XMemAllocblocks.Until the first walk has run, or with
VICTORY_PROCESS_MEMORY=0, the old figure is kept.Why it's off by default: telling the title it has room changes what it streams. That needs runs before it becomes the default.
How it was tested
cargo clippy --testsforx86_64-pc-windows-msvc(victory-hle,victory-gpu): no errors, and the warnings are the same as onmain. This was cross-checked from Linux, so nothing was built, linked or run on Windows.the_title_is_told_its_own_memory_when_asked(with #4548's figures, the process's commit gives 0 MB / load 100, and the title's own gives 6,476 MB / load 16) andthe_titles_own_memory_is_its_three_parts. They compile for the Windows target but were not run.cargo xtask policy --stagedpasses.Asking for a test: @AlbaDev1, you offered to test #4548. Could you run the same save with
VICTORY_TITLE_MEMORY=ownand say whether picking up the paint bucket still crashes? Your log's repeatingthe title asks how much memory it useslines should then showused_mbat the title's own size (its page pools are a few GB of it), under the limit rather than the process's 20-30 GB.Checked for overlap
XMemGetWorkingSetStatistics,GlobalMemoryStatusEx,title_memory, "working set"). Nothing changes what the title is told it uses. #1477 (closed) changed the limit, not the used figure.🤖 Generated with Claude Code
XMem: VICTORY_TITLE_MEMORY=own tells the title its own memory, not the process commit (#4547)to [pr-fix][memory] XMem: VICTORY_TITLE_MEMORY=own tells the title its own memory, not the process commit (#4547)[pr-fix][memory] XMem: VICTORY_TITLE_MEMORY=own tells the title its own memory, not the process commit (#4547)to XMem: VICTORY_TITLE_MEMORY=own tells the title its own memory, not the process commit (#4547)@tyr0nsur on GitHub · 2026-12-01 13:38 UTC · original
Ran the unchanged
9b20e9f1on Windows with Rust 1.98.1. Both of the added accounting tests pass, along with four existing tests:cargo test --locked -p victory-hle --lib -- modules::xmem::tests::the_title_is_told_its_own_memory_when_asked modules::xmem::tests::title_memory --test-threads=1: 2 passed.cargo test --locked -p victory-gpu --lib -- procmem::tests --test-threads=1: 4 passed, including a real process memory walk.#4909 supplies a Series X case for the same accounting symptom: 36,186 MiB process commit against a 13,824 MiB title limit, while local GPU usage was under the DXGI budget. The status was queried as Breakpad collected data. This supports the accounting rationale and leaves the crash cause open. These are native tests and log analysis. The save comparison with
VICTORY_TITLE_MEMORY=ownis still outstanding.@trustno1-coder on GitHub · 2026-12-01 18:36 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed