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

Closed
opened 2026-11-27 01:25:45 +00:00 by github-bot · 1 comment
Owner

@⁠tedin7 on GitHub · 2026-11-26 12:42 UTC · original

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** on GitHub · 2026-11-26 12:42 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/2832) 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`).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:25:45 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 12:42 UTC · original

Taking this one; a Draft PR will follow.

**@⁠tedin7** on GitHub · 2026-11-26 12:42 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/2832#issuecomment-7192359017) Taking this one; a Draft PR will follow.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/R0Y00--Xbox2Windows#2832
No description provided.