startup-runtime: the budget heartbeat does not say whether a commit failure comes from the job limit, the system commit or the page pool #2824

Closed
opened 2026-11-26 12:42:40 +00:00 by tedin7 · 1 comment
tedin7 commented 2026-11-26 12:42:40 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T12:42:40Z.


Part of #870 (related: #1199 tracks the commit pressure itself; this only makes failures attributable)

Problem. A startup run that ends on ERROR_COMMITMENT_LIMIT (1455) or ERROR_NOT_ENOUGH_MEMORY (8) from XMemMapPhysicalPagesScatter cannot be attributed from its log. Three different limits can produce the same error, and nothing in the log tells them apart:

  • the memory limit of the job the debugger puts the title in (run.ps1 -MemoryGiB, JobMemoryLimit),
  • the system commit limit (RAM plus page files),
  • the physical-page pool itself (live 64 KiB sections, slabs, slots), which x2w_xmem_page_stats and x2w_xmem_slab_stats already count but only the DirectStorage heartbeat prints (sections only).

The x2w-budget line (X2W_D3D12_BUDGET=1) lists DXGI usage and the resource categories, so it is the line a reader compares across a run, but it has none of these numbers. The failure line of the pool (x2w-xmem XMemMapPhysicalPagesScatter failed stage=map-view ... error=1455) names the page and the region but not how full any limit was.

Proposal.

  1. Append to every x2w-budget line: commit=<used>/<limit> avail=<free> (system commit, MiB), sections=<n> slabs=<n> slots=<in use>/<free> (the page pool) and job_peak=<MiB> job_limit=<MiB|none> (peak commit and memory limit of the job). Each reads n/a when it cannot be read.
  2. At the first three commit failures (1455 or 8) of the page pool, log one x2w-xmem commit exhausted at <call> (error N): ... line that says job memory limit N GiB reached (run.ps1 -MemoryGiB) when the job peak is within 256 MiB of its limit (otherwise job memory limit not reached), then the job numbers, the system commit and the pool counters, with the hint that X2W_XMEM_LAZY_COMMIT=1 (run.ps1 -LazyMemory) keeps untouched pages out of the commit.
  3. tools/startup/triage_run.py keeps reading the budget line with and without the new fields.

Done when a source-built check covers the text of the new fields and of the failure line (known and unknown values, job limit reached or not, which error codes count, the system commit is consistent), triage_run.py is checked against lines with and without the fields, and docs/startup-runtime.md describes them.

Source: Microsoft Learn, Win32 GlobalMemoryStatusEx, QueryInformationJobObject with JobObjectExtendedLimitInformation (JOBOBJECT_EXTENDED_LIMIT_INFORMATION: JobMemoryLimit, PeakJobMemoryUsed), system error codes 8 and 1455; earlier code of this repo (x2w_xmem_page_stats, x2w_xmem_slab_stats, report_budget).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6626884943 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2832). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T12:42:40Z. --- Part of #870 (related: #1199 tracks the commit pressure itself; this only makes failures attributable) **Problem.** A startup run that ends on `ERROR_COMMITMENT_LIMIT` (1455) or `ERROR_NOT_ENOUGH_MEMORY` (8) from `XMemMapPhysicalPagesScatter` cannot be attributed from its log. Three different limits can produce the same error, and nothing in the log tells them apart: - the memory limit of the job the debugger puts the title in (`run.ps1 -MemoryGiB`, `JobMemoryLimit`), - the system commit limit (RAM plus page files), - the physical-page pool itself (live 64 KiB sections, slabs, slots), which `x2w_xmem_page_stats` and `x2w_xmem_slab_stats` already count but only the DirectStorage heartbeat prints (sections only). The `x2w-budget` line (`X2W_D3D12_BUDGET=1`) lists DXGI usage and the resource categories, so it is the line a reader compares across a run, but it has none of these numbers. The failure line of the pool (`x2w-xmem XMemMapPhysicalPagesScatter failed stage=map-view ... error=1455`) names the page and the region but not how full any limit was. **Proposal.** 1. Append to every `x2w-budget` line: `commit=<used>/<limit> avail=<free>` (system commit, MiB), `sections=<n> slabs=<n> slots=<in use>/<free>` (the page pool) and `job_peak=<MiB> job_limit=<MiB|none>` (peak commit and memory limit of the job). Each reads `n/a` when it cannot be read. 2. At the first three commit failures (1455 or 8) of the page pool, log one `x2w-xmem commit exhausted at <call> (error N): ...` line that says `job memory limit N GiB reached (run.ps1 -MemoryGiB)` when the job peak is within 256 MiB of its limit (otherwise `job memory limit not reached`), then the job numbers, the system commit and the pool counters, with the hint that `X2W_XMEM_LAZY_COMMIT=1` (`run.ps1 -LazyMemory`) keeps untouched pages out of the commit. 3. `tools/startup/triage_run.py` keeps reading the budget line with and without the new fields. **Done when** a source-built check covers the text of the new fields and of the failure line (known and unknown values, job limit reached or not, which error codes count, the system commit is consistent), `triage_run.py` is checked against lines with and without the fields, and `docs/startup-runtime.md` describes them. Source: Microsoft Learn, Win32 `GlobalMemoryStatusEx`, `QueryInformationJobObject` with `JobObjectExtendedLimitInformation` (`JOBOBJECT_EXTENDED_LIMIT_INFORMATION`: `JobMemoryLimit`, `PeakJobMemoryUsed`), system error codes 8 and 1455; earlier code of this repo (`x2w_xmem_page_stats`, `x2w_xmem_slab_stats`, `report_budget`).
tedin7 commented 2026-11-26 13:03:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T12:42:42Z.


Taking this one; a Draft PR will follow.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7192359017 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2832#issuecomment-7192359017). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T12:42:42Z. --- Taking this one; a Draft PR will follow.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows#2824
No description provided.