Unbounded growth of LOOSE host copies during open-world play (D3D12 0x80070057 crash) #3646
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#3646
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Zendothony on GitHub · 2026-11-30 02:38 UTC · original
Unbounded growth of
LOOSEhost copies during open-world play (VRAM/RAM exhaustion, D3D12 0x80070057 crash)Summary
During extended open-world play (GTA 6, no mission/cutscene involved), the "host copies of title memory" count reported in
memory()/theprocess memory:log line grows continuously and never comes back down, eventually exhausting system RAM and/or exceeding the card's VRAM budget. The session ends with:preceded by lines such as:
This reproduces across multiple recent releases/builds and regardless of console profile (Series S and Series X both affected), with no custom env vars set beyond the F1 menu's own defaults. It is not tied to a specific mission — it happens whenever a session runs long enough (roughly 30–55 minutes under Series S / Performance / 540p / Frame Gen 2x / Preset K; as little as ~8 minutes under Ultra Performance / 360p, which seems to accelerate it).
Where it points in the source
crates/victory-gpu/src/shadow.rsholds the central cache:There's already a sweep meant to keep it bounded,
pub(crate) fn let_go_idle()(~line 4930), whose own doc comment describes this exact symptom as previously observed:let_go_idle()is invoked once a second fromsweep()incrates/victory-gpu/src/host.rs(~line 790), alongsidecrate::texture::let_go_idle()andcrate::resource::let_go_idle(), so call frequency isn't in question. Its eligibility filter requires (among other things)Arc::strong_count(s) == 1,crate::host::references(&s.buffer) == 1, andcrate::host::long_ago(s.used, idle_ms, IDLE_FRAMES), where the idle threshold comes fromcrate::host::ram_idle_ms(crate::host::available_physical_ram()).On a host with
ullTotalPhys <= 32 GiB(residency::limited_host_ram()returnstrue, since the check is<=),ram_idle_msalready takes the "not keeping freed" branch and uses the aggressive tier (2–10 s depending on free RAM), not the 5-minute "plenty of RAM" tier. So on 32 GB systems the sweep should already be reclaiming aggressively — and yet the counters keep climbing for the whole session.That suggests one of:
s.usedbefore the idle threshold elapses), so they never age past the filter even though the working set itself is unbounded — in which case the real fix is probably a hard cap (max bytes/entries) that forces eviction of the oldest entries regardless of idle time, rather than (or in addition to) a pure idle-time filter.Shadowentries that can never satisfy the filter (e.g. a reference held open-endedly elsewhere, soArc::strong_countorreferences(&s.buffer)never drop to 1).I haven't been able to instrument live counters inside a running session to distinguish 1 vs 2 — that would need debug logging added to
let_go_idle()itself (e.g. counting how manyLOOSEentries pass vs fail each individual condition in the filter, sampled periodically) to see whether entries are failing on strong_count, on references, or on the idle-time check.Repro conditions
series-sandseries-x.VICTORY_SOFT_VIEWS=copies,VICTORY_MENU_FG_TYPE=dlss,VICTORY_MENU_FRAMEGEN=2,VICTORY_DLSS_PRESET=k); reproduces both atVICTORY_MENU_DLSS=performance/VICTORY_MENU_S_RES=540(~30–55 min to crash) and atultraperformance/360(~8 min to crash).victory.exedirectly, nothing else).What would help
LOOSEentries faillet_go_idle()'s filter during a long open-world session (strong_count vs references vs idle-time), to confirm whether this is a true leak (dangling extra reference) vs. unbounded legitimate working-set growth that needs a hard byte/count cap instead of a pure idle-time eviction policy.LOOSEtotal bytes (evict oldest-by-s.usedfirst, independent of the idle-time check) seems like the safer short-term mitigation, similar to howcrate::pool/vram_keep_belowalready caps VRAM usage by percentage rather than purely by idle time.Happy to provide full session logs (they contain the
process memory:/host copies of title memory N (BYTES MB)progression every second for ~30-55 min sessions) if useful.@Trillazill on GitHub · 2026-11-30 08:38 UTC · original
Measurements for this, from two short runs on the diagnostics build (
--profile diag --features diagnostics) at41adb551(with or without #3754'sVICTORY_ROOM_BY_BLOCKS, which is off unless set), RTX 4080, windowed, same save. Each run was the menu, then a few minutes driving. The numbers come from thecopystatmemory lines; no logs are attached.What holds the windows (default switches)
About a minute after the world loaded:
windows outside buffers by use.let_go_idlecannot let any of them go, and that is right: they are in use.unsized_window: the 4 MiB cell plusreach's 2 MiB), 4.3 GB together, which is the whole count.So the growth reported here is not copies nothing names. It is windows far larger than what is read, held by slots that are in use.
The same with
VICTORY_WINDOW_GROW=1VICTORY_WINDOW_GROW=1Growing does cut the windows by ~1.6 GB and halves the overlap. But in these runs the process's private bytes did not go down: host textures were ~850 MB higher in the second run (a different spot in the world), and ~11–12 GB of the private bytes are unnamed in both. The windows are made again about five times as often, which costs CPU. One run each is too little to call it; it needs the same route twice per setting.
Also seen in both runs
~85–90 mesh pipelines failed with
0x8007000e(not enough memory) in each run. The first one came as the world loaded, while the PC still had GBs free, so this may be the driver's own limit rather than the system's. It is separate from this issue, but it could explain missing objects on machines that hit it.What could be done
VICTORY_WINDOW_GROWas a default needs a measured route first, given the five-fold remakes.I haven't written either yet. Happy to, if the maintainers think the first is the right direction.
@Trillazill on GitHub · 2026-11-30 09:52 UTC · original
Follow-up with a line that says what holds the PC's memory now (#3869, diagnostics only). Same PC (RTX 4080, 32 GB RAM), Series X, default switches, a few minutes into the world:
The shared buffers are the host copies of title memory: at the same moment, 1,064 windows outside buffers came to 6,496 MB. So most of what this issue sees grow after the world loads is the windows.
Three things about them:
Windows that go to the card keep their shared buffer too (
CardCpu::Shared, the CPU side the refresh goes through). 402 windows (2.4 GB) held both a card copy and a shared one.The overlap is larger in this run: 6,496 MB of windows over 4,922 MB of title memory, so 1.6 GB is the same memory held twice. That is the 2 MiB
reachof a window asked for without a length lying over the next cell's own window.Ruled out in the same session:
VICTORY_LIST_LAZY=1saved 20 MB at the menu.Neither textures pushed out of a full card nor host lists are where this memory goes.
So the levers for the RAM reports are the windows themselves: their size (
VICTORY_WINDOW_GROWcut 1.6 GB here earlier, at the cost of five times the remakes), their overlap, and whether a window on the card needs its shared copy for as long as it lives.