Skip to content

Diagnostics/process memory snapshot - #484

Closed
ToxicmaggotRP wants to merge 3 commits into
Marvisak:mainfrom
ToxicmaggotRP:diagnostics/process-memory-snapshot
Closed

ToxicmaggotRP wants to merge 3 commits into
Marvisak:mainfrom
ToxicmaggotRP:diagnostics/process-memory-snapshot

Conversation

@ToxicmaggotRP

Copy link
Copy Markdown

Diagnostics: report process private and resident memory

Related to #471 (memory growth during world load).

What

The diagnostics copy-stat line already samples process page faults through K32GetProcessMemoryInfo, but it only requests the base PROCESS_MEMORY_COUNTERS structure.

This change adds the extended counters needed to correlate copy-path measurements with the process's actual memory footprint:

  • Query PROCESS_MEMORY_COUNTERS_EX.
  • Log PrivateUsage (process private commit charge) and WorkingSetSize (resident working set) in GiB.
  • Preserve the previous successful page-fault sample if the OS query temporarily fails.
  • Omit the memory snapshot if the query fails, rather than logging misleading zero values.

This is process-wide telemetry. It does not attribute memory to individual pools or staging buffers, and it does not fix the memory ceiling by itself. It provides a reliable process-memory series to compare with existing copy statistics and the memory optimisations in #472.

Verification

  • Checked the repository's pinned windows-sys 0.61.2 API signature and structure fields.
  • Checked Microsoft's API contract for PROCESS_MEMORY_COUNTERS_EX.
  • Confirmed that only crates/victory-gpu/src/copystat.rs changes.
  • Branch is three commits ahead of main, with no upstream commits missing.
  • cargo fmt, cargo check -p victory-gpu --features diagnostics, tests, and a Windows diagnostics run were not performed because Rust/Cargo are unavailable in the development environment.

No game assets or proprietary files used.

AI-assisted contribution (ChatGPT).

@mercuryVM mercuryVM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested 3b7e1d5 on Windows 11, RTX 5070, MSVC: the workspace passes (264: 195 outside victory-shader, plus victory-shader --lib with --test-threads=1, 69 passed). The first full run timed out on the known parallel VALU GPU-test hang that #433 addresses, which has nothing to do with this change. cargo check -p victory-gpu --features diagnostics is clean.

  • K32GetProcessMemoryInfo with cb = size_of::<PROCESS_MEMORY_COUNTERS_EX>() and the base-struct pointer cast is the documented way to get PrivateUsage.
  • Keeping the previous fault sample when the query fails (instead of resetting it) avoids a one-interval spike of lifetime faults.
  • PrivateUsage (commit) and WorkingSetSize (resident) are the two numbers #471 needs.

Diagnostics only, so release builds are unchanged. No issues found.

AI-assisted (Claude Code).

mercuryVM added a commit to mercuryVM/VIctory that referenced this pull request Nov 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nazmi pushed a commit to nazmi/VIctory that referenced this pull request Nov 24, 2026
Applied as the net diff of upstream PR Marvisak#484 (head 3b7e1d5), 3 commits: 3b7e1d5,3d29e698,d9b14766.
edsuuu referenced this pull request in edsuuu/VI-BR-PORT Nov 24, 2026
…itives, capture), verified together

Merges #124 #119 #515 #934 #484 #143 #1191 #278 #553 #153 #270 #1158 #1204
#1220 #488 #1146 #631 onto main (ffe310e), each head unchanged, no conflicts,
no changes of mine. cargo clippy --workspace --all-targets --locked -- -D
warnings, with and without --all-features, is clean and cargo test
--workspace --locked passes (372 passed, 8 ignored; main has 342 passed,
6 ignored).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
geiyiliyabumo pushed a commit to geiyiliyabumo/VIctory that referenced this pull request Nov 25, 2026
A locked or sleeping display used to retry CreateDXGIFactory2 /
CreateSwapChainForHwnd on every frame (thousands of WARN lines per
minute). Keep a Retry schedule (100 ms doubling to 1 s), name which
presenter step failed, and unit-test the backoff math.

Refs Marvisak#484.

Co-authored-by: JMAN730 <JMAN730@users.noreply.github.com>
geiyiliyabumo pushed a commit to geiyiliyabumo/VIctory that referenced this pull request Nov 25, 2026
…-backoff-484-111a

GPU: back off swap-chain creation when the desktop cannot present (Marvisak#484)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants