Break the memory report down past VMA, by owner in system memory, and by growth over a session.

Every report adds a line for video memory outside VMA (the driver's usage and budget per heap against VMA's blocks, and counts of pipelines by kind and by last use, stage libraries, compute pipelines, layouts and descriptor pools, with the swapchain, DLSS and FSR sizes), a line that splits the process's commit by owner (the game's heap and maps, device-local memory, VMA's host blocks, the C runtime heap with the shader caches, pipeline tables, texture cache, log queue and flight recorder in it, the driver's pipeline cache data and the rest), and a line naming what grew by more than 64 MiB since the report before and since play began. Every ten minutes of play and at exit a ranking line orders the categories by growth and marks those that only climbed; tests/mem_growth_check.py checks that bookkeeping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-13 06:46:00 -05:00
parent a74503cd86
commit d9429b0c00
28 changed files with 926 additions and 13 deletions

View File

@@ -526,6 +526,13 @@ int plat_page_file_managed(void);
// This process's memory in bytes: resident (the working set) and private (Windows: committed private bytes; Linux: the
// resident anonymous pages). 0 when unknown.
void plat_process_memory(uint64_t *resident, uint64_t *private_bytes);
// The C runtime's malloc heap in bytes, for the memory report (vk_memory.c system_log): what it took from the system
// (committed) and what of that it handed out (used), and how many other heaps the process has (Windows: those DLLs made
// with HeapCreate, the graphics driver's among them; their sizes are not asked, as a heap made without serialization
// cannot be read while its owner uses it). 0 when unknown. Holds the heap's lock while it adds up, so it is called at
// report time only. Windows: HeapSummary of the heap malloc uses; Linux: glibc's mallinfo2 over every arena.
typedef struct { uint64_t committed, used; uint32_t other_heaps; } PlatHeapInfo;
void plat_heap_info(PlatHeapInfo *h);
// ---- child processes: a program with stdin and stdout piped to us (stderr discarded), no console window.
typedef struct PlatChild PlatChild;