Lower the engine's use of the PC's memory (RAM) #21

Open
opened 2026-11-28 22:22:27 +00:00 by edsuuu · 0 comments
edsuuu commented 2026-11-28 22:22:27 +00:00 (Migrated from github.com)
Contributor

Imported from edsuuu/VI-BR-PORT. Originally posted by edsuuu on 2026-11-28T22:22:27Z.


The engine holds a lot of the PC's memory: the game process goes past 20 GB in the opening and on the boat (24.8 GB seen on 28/11, 9.8 GB a few seconds after start), which leaves 16 GB machines short and pushes Windows into paging.

Where it goes

The console has one memory for the CPU and the GPU; on the PC the title's memory, the copies we keep of its buffers and textures, and what the card's memory spills into all live in RAM at once. The map of what we hold (from the diagnostics runs of 27 and 28/11) is in the work of agente/api-ram, now on dev:

  • VICTORY_RAM_LOG (on): one line a minute with what the engine holds, by kind (windows of title memory, copies of the title's buffers, the lists' scratch, staging blocks, kept send buffers).
  • VICTORY_LOW_RAM (off): smaller caps on what is kept for reuse (VICTORY_SCRATCH_KEPT_MB, VICTORY_SEND_KEPT_MB, VICTORY_STAGING_BLOCKS_KEPT, VICTORY_IDLE_LISTS_MAX), about 0.6 to 1.3 GB less (estimate).
  • VICTORY_WINDOW_SHARE (off, 1 or 2): windows of title memory shared, up to 0.2 GB (prison) to 1.6 GB (boat) less (estimate).
  • VICTORY_RAM_ASSUME_FREE_MB: a large machine behaves like a 16 GB one, to test it.

None of these were measured in the game yet.

To do

  1. Measure with VICTORY_RAM_LOG in the opening, the prison and the boat, with each switch off and on; keep the ones that lower memory without costing frames or breaking the picture, and turn them on by default (or by the launcher's profile for 16 GB machines).
  2. The bigger cuts the map names but nobody tried (higher risk, need runs):
    • sparse windows of title memory, by tiles, instead of whole windows;
    • letting go of windows held only by descriptor slots;
    • the 786 MB mirror of the title's buffers (touches the send and copy-back path);
    • Evict of resources the frame does not use.
  3. Show it: the stats panel (F3) and the launcher say the process's memory against the machine's.

Related: PR #9 (a LowVram profile for 6 GB cards) works on the card's memory, not the PC's.

<!-- greyfinch-sync:edsuuu/VI-BR-PORT:issue:6671848851 --> Imported from [edsuuu/VI-BR-PORT](https://github.com/edsuuu/VI-BR-PORT/issues/21). Originally posted by [edsuuu](https://github.com/edsuuu) on 2026-11-28T22:22:27Z. --- The engine holds a lot of the PC's memory: the game process goes past 20 GB in the opening and on the boat (24.8 GB seen on 28/11, 9.8 GB a few seconds after start), which leaves 16 GB machines short and pushes Windows into paging. ## Where it goes The console has one memory for the CPU and the GPU; on the PC the title's memory, the copies we keep of its buffers and textures, and what the card's memory spills into all live in RAM at once. The map of what we hold (from the diagnostics runs of 27 and 28/11) is in the work of `agente/api-ram`, now on `dev`: - `VICTORY_RAM_LOG` (on): one line a minute with what the engine holds, by kind (windows of title memory, copies of the title's buffers, the lists' scratch, staging blocks, kept send buffers). - `VICTORY_LOW_RAM` (off): smaller caps on what is kept for reuse (`VICTORY_SCRATCH_KEPT_MB`, `VICTORY_SEND_KEPT_MB`, `VICTORY_STAGING_BLOCKS_KEPT`, `VICTORY_IDLE_LISTS_MAX`), about 0.6 to 1.3 GB less (estimate). - `VICTORY_WINDOW_SHARE` (off, `1` or `2`): windows of title memory shared, up to 0.2 GB (prison) to 1.6 GB (boat) less (estimate). - `VICTORY_RAM_ASSUME_FREE_MB`: a large machine behaves like a 16 GB one, to test it. None of these were measured in the game yet. ## To do 1. **Measure** with `VICTORY_RAM_LOG` in the opening, the prison and the boat, with each switch off and on; keep the ones that lower memory without costing frames or breaking the picture, and turn them on by default (or by the launcher's profile for 16 GB machines). 2. **The bigger cuts the map names but nobody tried** (higher risk, need runs): - sparse windows of title memory, by tiles, instead of whole windows; - letting go of windows held only by descriptor slots; - the 786 MB mirror of the title's buffers (touches the send and copy-back path); - `Evict` of resources the frame does not use. 3. **Show it**: the stats panel (F3) and the launcher say the process's memory against the machine's. Related: PR #9 (a LowVram profile for 6 GB cards) works on the card's memory, not the PC's.
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
edsuuu/VI-BR-PORT#21
No description provided.