A memory line at every crash and while the title runs: process and system commit, video memory, what the title asked for #194
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!194
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-194"
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?
@gbuyssens on GitHub · 2026-11-23 20:02 UTC · original
gbuyssens:pr/memory-report→main· +223 −2 · 7 files · 1 commits · open…stem commit, video memory, what the title asked for
A title that runs out of memory dies in an allocation of its own far from the cause (a write to address 0 in its thread start-up; the driver's E_OUTOFMEMORY on a pipeline). memstat.rs logs one line – the process's commit charge and working set, the system's commit against its limit and free RAM, local and non-local video memory in use (IDXGIAdapter3), the bytes the title asked kernelx for by kind (sparse / UMA graphics memory, Windows commits, XMemAlloc heaps, the homes of its physical pages; gross) and the sparse windows' tiles and pools – at every unhandled exception, when the process ends with an error, and from a thread whenever the commit grew by a GiB (every 30 s at most).
The crash line carries the code bytes at RIP for every exception, not only illegal instructions: the registers alone rarely say what was dereferenced.
@Kalmarv on GitHub · 2026-11-23 20:41 UTC · original
I tested PR head
9e79c69db8a11cebde2ef32b23f41b620c7efa6ddirectly on Windows 11 build 26200, with a test-only probe in the synthetic process. All three runs passed: an uncapped CPU run, a CPU process with a 1 GiB process commit limit, and a DXGI run on an RTX 5070 Ti in an 8 GiB job.A touched 128 MiB allocation raised private commit and working set by approximately 128 MiB in each run. Both fields agreed with a separate process-counter read within 1 MiB. The no-device control omitted the video fields. With the device initialized, I independently enumerated adapters, matched the device LUID and queried node 0. The two readers agreed byte-for-byte on local usage and budget (13,488,128 / 15,966,666,752 bytes) and nonlocal usage and budget (567,066,624 / 15,913,553,920 bytes).
One portability correction: for fields labelled system commit, use
GetPerformanceInfoand multiplyCommitTotalandCommitLimitbyPageSize. Both numbers agreed in all three runs here, butMEMORYSTATUSEXdocuments its limit and available commit in terms of what the calling process can commit. ItsullAvailPhysfield is available RAM, which includes standby pages, so “RAM available” would also be more precise than “RAM free”. Microsoft’s field definitionsOn the reporting hot path, successful tracked allocations/commits add a relaxed atomic increment, including individual physical-page operations. Rendering and presentation have no new polling calls. The sampling worker checks process counters every 30 seconds and builds the full line only on its growth threshold. This is a source-level overhead check. I did not measure frame times, trigger a real crash or run a title.
@upipibi on GitHub · 2026-11-24 05:29 UTC · original
One ordering point in
9e79c69, from reading the code (not run): in the crash handler,memstat::log()runs beforereport::write_final(Some(msg))(eh.rs:113-114, and again at:136). Nothing callsmemstat::adapter()before a crash, so the first call creates a DXGI factory and enumerates adapters inside the handler, and every call then goes into the driver withQueryVideoMemoryInfo(memstat.rsadapter/video). The crashes this line is meant to explain (out of memory, or a fault in the driver itself) are the ones where that call is most likely to block or fault again, and then the report is never written.try_lockalready covers a crash in a thread that holds the lock, but not this.Two cheap changes would keep the report safe: write the report first and log the memory line after it, and resolve the adapter when the device is created (e.g. from
real::init), so the handler only does the two queries.Also: this now conflicts with
mainineh.rsandkernelx.rs.AI-assisted (Claude Code), read-only review.
@DavidM1911 on GitHub · 2026-11-25 15:19 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.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.