Make the memory report's system line name the write-combined views, the recording copies and the handles.

The system line took the driver's device-local figure out of the process's commit, but the driver's write-combined views of that memory came to 0.2-1.1 GiB more, and that part went to "other": in the 2026-11-13 session other system memory grew 1,283 MiB in play while the process's own commit grew 307. With a walk of the address space (mem_census) less than a minute old, the gap at that walk is now a term of its own. The NVN recording copies, malloc'd, count among the C runtime heap's known parts with those unused for 5 minutes, and the line ends with the process's handle count, which rose at every area load in that session and never fell.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-13 12:48:00 -05:00
parent cacb1318fc
commit 67cef75920
4 changed files with 39 additions and 8 deletions

View File

@@ -2248,6 +2248,15 @@ void plat_process_memory(uint64_t *resident, uint64_t *private_bytes) {
fclose(f);
}
uint32_t plat_handle_count(void) {
DIR *d = opendir("/proc/self/fd");
if (!d) return 0;
uint32_t n = 0;
for (struct dirent *e; (e = readdir(d));) n += e->d_name[0] != '.';
closedir(d);
return n ? n - 1 : 0; // less the descriptor of this walk
}
// glibc's mallinfo2 (2.33 and later) sums every arena: arena is what the arenas took with brk and mmap, hblkhd the
// blocks mmapped one by one, uordblks what the arenas handed out. Other C libraries leave the figures unknown.
void plat_heap_info(PlatHeapInfo *h) {

View File

@@ -536,6 +536,8 @@ 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 handles (Windows) or file descriptors (Linux) this process holds; 0 when unknown.
uint32_t plat_handle_count(void);
// 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

View File

@@ -2183,6 +2183,11 @@ void plat_process_memory(uint64_t *resident, uint64_t *private_bytes) {
*resident = pm.WorkingSetSize, *private_bytes = pm.PrivateUsage;
}
uint32_t plat_handle_count(void) {
DWORD n = 0;
return GetProcessHandleCount(GetCurrentProcess(), &n) ? (uint32_t)n : 0;
}
// The UCRT's malloc takes its memory from the heap _get_heap_handle names (the process heap); HeapSummary sums it. The
// other heaps are only counted: one made with HEAP_NO_SERIALIZE has no lock to take.
void plat_heap_info(PlatHeapInfo *h) {