Memory profiling: 5.67 GiB retained by a single shadow.rs allocation call site — RTX 5060 8GB #2024
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kartincev057-byte on 2026-11-29T07:46:38Z.
I've been working on an experimental VIctory branch called ARS (Adaptive Resource System), focused on investigating performance, memory management, and resource lifetimes.
Across three development milestones (M1, M2, and M2.1), I implemented additional profiling for system memory, GPU memory, DXGI budgets, allocation ownership, memory pools, deferred resource retirement, and texture streaming.
I'd like to share some hardware profiling results that may contribute to ongoing VIctory optimization efforts.
ARS_M2.1_RTX5060_Profiling_Public.zip
Latest tested build:
ARS M2.1 — d2167786f60081908103ad7a4c58f90d5cca39651. Comparison across three development milestones
All memory values are in GiB.
The sessions included different gameplay scenes, so these results should not be interpreted as a controlled A/B benchmark.
2. Main finding: shadow.rs
After adding per-call-site allocation ownership telemetry in M2.1, I was able to identify the largest contributor to tracked Upload/Readback memory.
A single allocation call site retained approximately 5.67 GiB, accounting for approximately 82.3% of all tracked Upload/Readback allocations.
The source line refers to the specific experimental branch commit listed above.
Resources are being released: approximately 5.42 GiB of cumulative allocations were freed throughout the session.
Therefore, the current evidence is insufficient to classify this behavior as a conventional memory leak.
The next step is to determine how much of this memory belongs to the required working set and how much may be retained unnecessarily.
3. Memory growth over time
Selected samples from the largest allocation owner:
The interval between 441 and 466 seconds is particularly interesting: the number of live objects increased by 107, while retained memory increased by approximately 666 MiB.
Continued RAM and VRAM growth was also observed while the character and camera remained stationary. However, the exact boundaries of the stationary period were not marked in the telemetry.
4. Deferred Resource Retirement
M2 introduced an experimental mechanism for coalescing duplicate retirement references.
The peak retirement queue entry count decreased by approximately 94.3% between M1 and M2.
This does not imply an equivalent reduction in unique resources or physical memory usage.
Further validation of COM ownership, resource generations, and GPU fence dependencies is required.
5. Texture streaming and the memory/correctness trade-off
M2 exhibited significant texture queue accumulation:
M2.1 modified texture queue admission and processing policies.
The final CSV sample reported zero due slots. However, the last corresponding line in the main log before shutdown still reported 348 due slots. Complete elimination of texture starvation has not been established.
Visual material loading improved substantially, but tracked texture allocations increased from 3.30 to 4.49 GiB.
This suggests a potential trade-off between limiting memory consumption and preserving rendering correctness.
6. DLSS and Frame Generation
After integrating changes related to #856:
DLSS Frame Generation 2X activated successfully but was disabled approximately nine seconds later.
Correct handling of Streamline status 39 allowed budget warnings to be distinguished from actual DLSS evaluation failures.
However, GPU memory pressure remains unresolved.
7. Ineffective idle buffer trimming
Another finding from M2.1:
Despite 271 recorded send-buffer trim attempts, the mechanism recorded no reclaimed memory.
Reclamation eligibility, minimum pool reserves, last-use timestamps, and fence completion conditions require further investigation.
8. Potential investigation targets
Conclusion
I'm continuing this investigation in ARS M2.2.
I'm not claiming to have established a memory leak or resolved the issues described above. The purpose of this report is to share concrete hardware measurements and help identify potential optimization targets.
Has anyone previously investigated the lifetime of committed-shared-L0 allocations in shadow.rs, or ways to reduce this working set without compromising CPU/GPU coherency?
I'd be happy to share sanitized CSV files, detailed logs, the profiling implementation, and further experimental results.
Development was AI-assisted using OpenAI Codex. All reported hardware measurements were collected during actual execution on my own PC.
Thanks to everyone contributing to VIctory!
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ArturoWolff on 2026-11-29T07:58:21Z.
Thanks for the careful distinction between live allocations, cumulative frees and a proven leak. The closely related existing work is #1823, which changes eligible persistent CPU-only buffer mirrors from shared D3D12 memory to ordinary pageable process memory while retaining GPU readback/copy correctness checks.
Our independent Linux/Proton RTX 4060 8 GB / 16 GB RAM validation and startup follow-up supports the DXGI nonlocal accounting change on synthetic data. It did not establish a physical host-RAM saving or a gameplay improvement; the actual startup comparison was interrupted on the control arm, and observed private mirrors were only 174 MiB at that earlier workload milestone. Those bytes are not comparable to your later gameplay allocation-owner census.
Your 5.67 GiB attributed live set is useful motivation for comparing the eligible mirror bytes, actual shared allocation lifetime and fence retirement with matched scene/progress and the same source revision. I would keep unique underlying allocations, reference counts, residency and cumulative allocations separate. I do not have evidence that all of the reported live memory is redundant or that moving it into pageable memory alone resolves the working-set problem.
AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kartincev057-byte on 2026-11-29T08:03:02Z.
@ArturoWolff Thanks for the detailed response and the reference to #1823!
Interestingly, our ongoing M2.2 investigation has identified a potential source of excessive memory allocation within
shadow::loose. Root CBV accesses that update at most 64 KiB could previously trigger the creation of a 6 MiB backing window.We've implemented a conservative optimization for unaligned CBVs. Shorter windows for aligned CBVs and fence-aware L0 buffer reuse remain experimental due to potential CPU/GPU coherency risks.
M2.2 has just been built, and hardware validation on my RTX 5060 8 GB is starting now.
I'll definitely investigate #1823 and its compatibility with ARS. I agree that reducing DXGI nonlocal usage does not necessarily translate into physical RAM savings.
Thank you for sharing your research. I'll post the new hardware measurements once testing is complete!
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by steven-seagull27 on 2026-11-29T08:56:14Z.
Opened PR #2063 targeting the loose root CBV allocation path in
crates/victory-gpu/src/draw.rs+crates/victory-gpu/src/shadow.rs:shadow::find(address, 0), allocating and pinning 6 MiBshadow::LOOSEbuffers thatplace_constantcould never bind (forcing scratch copy anyway). They now route directly to scratch viashadow::find_root_cbvwithout touchingshadow::LOOSE.shadow::loose(..., /* unsized_ask = */ false, false)for a sized 64 KiB (ROOT_CBV_LEN) range instead ofunsized_ask = true, avoiding 6 MiBgrow_reach/ fine-grid expansion andunsized_asksinflation.< 64 KiBregistered buffers and unaligned offsets into registered buffers continue hittingBUFFERSfirst and clamping toshadow.left(address).Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-30T15:37:45Z.
Closing this because it was opened before v2026.11.29.01, and a great deal has changed since then. The latest release is v2026.11.30.01.
If this still happens, or still applies, on the latest release, please open a new issue. For a bug, attach both logs from that run:
victory-nvidia-play-<date>-<time>-<number>.login%LOCALAPPDATA%\victory\logs\.%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, plus the newest.crash.login%LOCALAPPDATA%\VIctory\data\7952987A\temp\if there is one from that run.