v2026.11.29.01 fails to start: XMemVirtualAlloc refuses 6.24 GB MEM_RESERVE_PLACEHOLDER (os error 8) #2150

Closed
opened 2026-11-29 10:01:22 +00:00 by github-bot · 2 comments
Owner

@⁠LasVegas38919 on GitHub · 2026-11-29 09:58 UTC · original

Summary

v2026.11.29.01 fails to start on this machine: XMemVirtualAlloc refuses a 6.24 GB 64K-page reservation. v2026.11.28.03 runs fine with the same game files and the same command line.

Environment

  • Windows 11 build 22621, x64
  • Ryzen 7 9800X3D, 32 GB RAM, RTX 3090 (24 GB), driver 610.62
  • Source: Xbox GDK build game_scarlett_master.exe (PE Machine = 0x8664, x64)
  • Page file: C: 32 GB, S: 32 GB, X: 4.6 GB (system managed where noted)

The failing call

WARN victory_hle::modules::xmem: XMemVirtualAlloc refused size=6538919936 kind=0x42000 flags=0x23
     error=<内存资源不足,无法处理此命令。> (os error 8)

kind=0x42000 is MEM_RESERVE | MEM_RESERVE_PLACEHOLDER, flags=0x23 includes PAGES_64K.
The very next line reports the request itself:

INFO victory_hle::modules::xmem: title memory asked for as protection 0x2004, kind 0x42000,
     flags 0x23: 1 times, 6236 MB, last 0x0+0x185c00000

Then the title's Breakpad handler fires and the game exits.

This is not a memory shortage

Measured immediately after the crash:

  • physical 31.18 GB total, 22.73 GB free
  • commit limit 99.68 GB, 87.93 GB available
  • the only process running was the game plus the layer

So the system had plenty of commit and physical memory. The 6.24 GB placeholder
reservation simply does not find a contiguous hole inside the range the layer asks for.

What changed between builds

In the new build, 64K-page reservations go through MEM_RESERVE_PLACEHOLDER
(crates/victory-hle/src/modules/xmem.rs:199-215), and address_range()
(xmem.rs) constrains the search to 1 << 32 .. (1 << 40) - 1 (4 GB .. 1 TB).
The title has already taken, inside that same window:

last 0x100000000 + 0x600000000   (24 GB)
last 0x700000000 + 0x600000000   (24 GB)
last 0xd00000000 + 0x49400000    (1.17 GB)
last 0xd49400000 + 0x89700000    (2.19 GB)

With plain MEM_RESERVE (the 28.03 behaviour) the allocator is free to place the
block anywhere and the game starts. With placeholders it must fit between those
and fails.

Reproduction

victory play "X:\...\Game\game_scarlett_master.exe" --res 1080to1440 --dlss quality --fps 30

3 of 3 attempts crashed at the same address with identical size. Neither
VICTORY_XMEM_SECTIONS=1 nor VICTORY_WATCH_LARGE_XMEM=0 changed anything
(those are the only nearby knobs; none of the 14 environment variables in
xmem.rs disables the placeholder path).

Suggested fix

Fall back to a plain reservation when the placeholder call fails — that is the
28.03 behaviour:

let mut at = allocate(kind);
if at.is_null() && kind & MEM_RESERVE_PLACEHOLDER != 0 {
    kind &= !MEM_RESERVE_PLACEHOLDER;
    at = allocate(kind);
}

A retry with Highest widened, or asking for the placeholder without a fixed
low bound, would very likely work as well.

Happy to test a patched build on this machine — it reproduces 100%.

**@⁠LasVegas38919** on GitHub · 2026-11-29 09:58 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2150) ## Summary `v2026.11.29.01` fails to start on this machine: `XMemVirtualAlloc` refuses a 6.24 GB 64K-page reservation. `v2026.11.28.03` runs fine with the same game files and the same command line. ## Environment - Windows 11 build 22621, x64 - Ryzen 7 9800X3D, 32 GB RAM, RTX 3090 (24 GB), driver 610.62 - Source: Xbox GDK build `game_scarlett_master.exe` (PE `Machine = 0x8664`, x64) - Page file: C: 32 GB, S: 32 GB, X: 4.6 GB (system managed where noted) ## The failing call ``` WARN victory_hle::modules::xmem: XMemVirtualAlloc refused size=6538919936 kind=0x42000 flags=0x23 error=<内存资源不足,无法处理此命令。> (os error 8) ``` `kind=0x42000` is `MEM_RESERVE | MEM_RESERVE_PLACEHOLDER`, `flags=0x23` includes `PAGES_64K`. The very next line reports the request itself: ``` INFO victory_hle::modules::xmem: title memory asked for as protection 0x2004, kind 0x42000, flags 0x23: 1 times, 6236 MB, last 0x0+0x185c00000 ``` Then the title's Breakpad handler fires and the game exits. ## This is not a memory shortage Measured immediately after the crash: - physical 31.18 GB total, 22.73 GB free - commit limit 99.68 GB, 87.93 GB available - the only process running was the game plus the layer So the system had plenty of commit and physical memory. The 6.24 GB placeholder reservation simply does not find a contiguous hole inside the range the layer asks for. ## What changed between builds In the new build, 64K-page reservations go through `MEM_RESERVE_PLACEHOLDER` (`crates/victory-hle/src/modules/xmem.rs:199-215`), and `address_range()` (`xmem.rs`) constrains the search to `1 << 32 .. (1 << 40) - 1` (4 GB .. 1 TB). The title has already taken, inside that same window: ``` last 0x100000000 + 0x600000000 (24 GB) last 0x700000000 + 0x600000000 (24 GB) last 0xd00000000 + 0x49400000 (1.17 GB) last 0xd49400000 + 0x89700000 (2.19 GB) ``` With plain `MEM_RESERVE` (the 28.03 behaviour) the allocator is free to place the block anywhere and the game starts. With placeholders it must fit between those and fails. ## Reproduction ``` victory play "X:\...\Game\game_scarlett_master.exe" --res 1080to1440 --dlss quality --fps 30 ``` 3 of 3 attempts crashed at the same address with identical size. Neither `VICTORY_XMEM_SECTIONS=1` nor `VICTORY_WATCH_LARGE_XMEM=0` changed anything (those are the only nearby knobs; none of the 14 environment variables in `xmem.rs` disables the placeholder path). ## Suggested fix Fall back to a plain reservation when the placeholder call fails — that is the 28.03 behaviour: ```rust let mut at = allocate(kind); if at.is_null() && kind & MEM_RESERVE_PLACEHOLDER != 0 { kind &= !MEM_RESERVE_PLACEHOLDER; at = allocate(kind); } ``` A retry with `Highest` widened, or asking for the placeholder without a fixed low bound, would very likely work as well. Happy to test a patched build on this machine — it reproduces 100%.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 10:01:22 +00:00
Author
Owner

@⁠LasVegas38919 on GitHub · 2026-11-29 10:16 UTC · original

Correction to my own report — two things in the original body are wrong.

1. The address range is 4 GiB .. 128 GiB-1, not 4 GiB .. 1 TiB.

xmem.rs:148 is const TITLE_TOP_BITS: u32 = 37;, and xmem.rs:165 clamps with
bits.min(TITLE_TOP_BITS), so the 40 bits the flags ask for never reach the
allocator. xmem.rs:3785 even asserts highest < 1 << TITLE_TOP_BITS. So the
window is 128 GiB wide in total, and per #2081 / #2133 the largest free span
left in it is about 3.46 GiB — a 6.24 GiB request can never fit, no matter
where the allocator looks.

2. Retracting the "drop MEM_RESERVE_PLACEHOLDER and retry" suggestion.

That fallback is wrong on two counts:

  • It would not even fire reliably: the existing retry at xmem.rs:253 only runs
    when watch_placement is set (a fixed base with write-watch). A null-base
    placeholder request never reaches it, and re-issuing the same size against the
    same capped range fails the same way.
  • It would break placeholder semantics. The region is later split with
    VirtualFree(MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER) (xmem.rs:2606) and
    overlaid with MapViewOfFile3(MEM_REPLACE_PLACEHOLDER) (xmem.rs:2825), the
    allocation is recorded as a placeholder at xmem.rs:194, partial replacement
    relies on it (xmem.rs:3540), and the lazy-mapping path only checks
    VirtualQuery for MEM_RESERVE/base/size (xmem.rs:3149, xmem.rs:3328) —
    a plain reservation passes that check and only fails later when the view is
    materialised. That turns a clean startup failure into a much harder bug.

This is #2081, and PR #2133 already has the right shape: keep the capped
range first, and only on failure retry up to console_top(flags) (the console
field's own 40-bit limit, as before #1041). I have applied #2133's diff to
v2026.11.29.01 locally and am building it on this machine (9800X3D / RTX 3090 /
32 GB / Win11 22621, reproduces 100% on the unpatched build) — I will report back
with the log line and whether the title gets past +0x1e6c284.

**@⁠LasVegas38919** on GitHub · 2026-11-29 10:16 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2150#issuecomment-7254320028) Correction to my own report — two things in the original body are wrong. **1. The address range is 4 GiB .. 128 GiB-1, not 4 GiB .. 1 TiB.** `xmem.rs:148` is `const TITLE_TOP_BITS: u32 = 37;`, and `xmem.rs:165` clamps with `bits.min(TITLE_TOP_BITS)`, so the 40 bits the flags ask for never reach the allocator. `xmem.rs:3785` even asserts `highest < 1 << TITLE_TOP_BITS`. So the window is 128 GiB wide in total, and per #2081 / #2133 the largest free span left in it is about **3.46 GiB** — a 6.24 GiB request can never fit, no matter where the allocator looks. **2. Retracting the "drop MEM_RESERVE_PLACEHOLDER and retry" suggestion.** That fallback is wrong on two counts: - It would not even fire reliably: the existing retry at `xmem.rs:253` only runs when `watch_placement` is set (a fixed base with write-watch). A null-base placeholder request never reaches it, and re-issuing the same size against the same capped range fails the same way. - It would break placeholder semantics. The region is later split with `VirtualFree(MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER)` (`xmem.rs:2606`) and overlaid with `MapViewOfFile3(MEM_REPLACE_PLACEHOLDER)` (`xmem.rs:2825`), the allocation is recorded as a placeholder at `xmem.rs:194`, partial replacement relies on it (`xmem.rs:3540`), and the lazy-mapping path only checks `VirtualQuery` for `MEM_RESERVE`/base/size (`xmem.rs:3149`, `xmem.rs:3328`) — a plain reservation passes that check and only fails later when the view is materialised. That turns a clean startup failure into a much harder bug. **This is #2081, and PR #2133 already has the right shape**: keep the capped range first, and only on failure retry up to `console_top(flags)` (the console field's own 40-bit limit, as before #1041). I have applied #2133's diff to v2026.11.29.01 locally and am building it on this machine (9800X3D / RTX 3090 / 32 GB / Win11 22621, reproduces 100% on the unpatched build) — I will report back with the log line and whether the title gets past `+0x1e6c284`.
Author
Owner

@⁠LasVegas38919 on GitHub · 2026-11-29 11:55 UTC · original

Okay, I'm retrying the approach — if anything new comes up, I'll report it right away.

**@⁠LasVegas38919** on GitHub · 2026-11-29 11:55 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2150#issuecomment-7255440421) Okay, I'm retrying the approach — if anything new comes up, I'll report it right away.
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/trustno1-coder--VIctory-NVIDIA#2150
No description provided.