Log the memory by owner every 3600 frames, and how often released textures come back.

Every VMA allocation is counted under the file that made it until it is freed, so the new "mem: by owner" line
splits the device-local memory the driver reports into textures (live, GPU-drawn, idle, released, released too
lately to drop), pools and VRAM mirrors, upscalers, replay buffers, uniform snapshots, the device address table,
the ASTC decoder, present and post-processing, headroom spares, the free space inside VMA's blocks and what VMA
never allocated. "mem: host" gives the host-visible allocations, the process's commit and working set and the
game's heap. "vk: released textures" counts take-backs by how long the texture was released and textures made
again after a drop by a bound or a pressure, with the drop's reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-12 23:10:09 -05:00
parent 4f80dbcbc2
commit 2820781fb7
7 changed files with 302 additions and 30 deletions

View File

@@ -196,6 +196,9 @@ int mem_start_note(int probe); // a game's start: a
// below the game's need (mem_need.h); 1 when it is
void mem_guest_census(uint64_t frame); // NX2NAVI_TRACE=perf: committed bytes per guest region
void mem_lazy_heap_report(uint64_t frame); // NX2NAVI_TRACE=perf: the lazy heap's faults since the last line
// The game's own memory for the memory report (vk_memory.c owner_log): its heap's size, the part of it committed (the
// size itself unless the heap is lazy), and the physical memory it mapped. No lock: a log may read a figure late.
void mem_guest_usage(uint64_t *heap, uint64_t *heap_committed, uint64_t *phys_maps);
uint32_t mem_set_heap_size(uint64_t size, uint64_t *addr); // 0x01
uint32_t mem_set_permission(uint64_t a, uint64_t n, uint32_t perm); // 0x02
uint32_t mem_set_attribute(uint64_t a, uint64_t n, uint32_t mask, uint32_t at); // 0x03