Warn in the log at the start when the machine has less memory free than the game takes in play.

The game held 23.9 to 24.4 GB of commit in three sessions on an RTX 5090 at 3840x2160, flat over the session, on a
machine whose commit stood at 66 of 73 GB with it. A machine that cannot give it that much pages, drops textures or
loses the device, and its log said nothing about memory until then.

mem_start_note reads the system's commit when a game starts and writes one warning line when what is free, plus what
the process already holds, is below mem_need_mb (24576 by default, 0 for no warning). The menu has no place for a
start-up notice (its only toasts are the co-op page's), so the line is in the log alone.

tests/mem_need_check.py checks the rule and, through --probe-memneed, the answer and the warning line with the
machine's own commit.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-11 04:48:36 -05:00
parent 39fa0be78c
commit 147e8a02e3
9 changed files with 177 additions and 4 deletions

View File

@@ -738,6 +738,11 @@
# Each walk holds the address-space lock for 100-240 ms and delays the next frame by as much, so they are off unless
# asked for.
# mem_census = 0
# The memory the game is taken to need, in MB of commit (RAM plus page file not yet promised to a program). When less
# is free at the start, the log gets a warning line: short of memory the game stutters, loses textures or stops with
# an out-of-memory or lost-device error. The default is what the game took in play at 3840x2160 on an RTX 5090; the
# video card's memory counts on Windows. 0: no warning. Default: 24576.
# mem_need_mb = 24576
# The size in MiB (16 to 256) of the blocks the renderer takes video memory in. A block goes back to the driver only once
# everything in it is freed, so smaller blocks hold less free space after area changes; larger ones need fewer
# allocations while an area loads. Default: 64.