Repository navigation
Conversation
The memory map counted every private allocation of 0xFD0000 bytes (the size of an NT heap segment) as "process heap segments". On an RX 9070 XT nearly all of them belonged to another heap: AMD's shader compiler (amdxc64.dll) keeps a heap of its own, and while it compiled compute 39f0e9aeb156a61c without end that heap grew to 13.8, 24.3 and 31.9 GB at 4, 6.5 and 9.5 minutes, read as the process heap and so as "ours, the runtime's or the driver's alike". That heap is not in the process's heap list either, so UMDH never shows it. Each such allocation's segment header (signature 0xffeeffee at +0x10, the owning heap at +0x28) is now read, through ReadProcessMemory so that an unreadable page fails instead of faulting. The process heap's segments keep their line; other heaps' segments get a kind of their own, and a new line names the biggest other heaps with their segments and committed bytes.
|
Seen in the game, same run ( with |
|
Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head AI-assisted (Claude Code); no game data. |
…heap header apart A 15.8 MB allocation whose header could not be read went under "heap 0x0: N MB in 0 segments" and counted as one of the other heaps. It now reads "N MB in M allocations with no readable heap header", with the allocations counted, and is left out of the number of heaps. The line is worked out by other_heaps, which a test now covers.
The memory map counts every private allocation of
0xFD0000bytes (an NT heap segment) as "process heap segments", andOWN's comment reads them as "ours, the graphics runtime's and the driver's alike". On an RX 9070 XT nearly all of them belonged to another heap: AMD's shader compiler (amdxc64.dll) keeps a heap of its own, and while it compiledcompute 39f0e9aeb156a61cwithout end (see #172) that heap grew to 13.8, 24.3 and 31.9 GB at 4, 6.5 and 9.5 min, until the process ran out of commit. That heap is not in the process's heap list either, so UMDH never shows it; it took an outside probe of the segment headers to find it.Change
segment_heap(base)reads a segment's header (64-bitHEAP_SEGMENT: signature0xffeeffeeat +0x10, the owning heap at +0x28) throughReadProcessMemoryon our own process, so an unreadable page fails the call instead of faulting.0xFD0000allocations whose header names the process heap keep their line; the others get a kind of their own at the end ofKINDS(segments of other heaps (private, 15.8 MB each)), so the existing kinds keep their numbers and text.memory map, heaps other than the process heap (N, the biggest first): heap 0x…: 31910 MB in 2109 segments; …(heap 0 for allocations whose header could not be read).OWN's comment says other heaps count apart.One header read per such allocation, during the walk that already runs on its own thread.
Tests
copystat::heap_tests::segments_name_their_heap: the process heap's first segment names it; a private heap (HeapCreate) filled with 20,000 blocks adds a segment whose header names that heap, not the process heap; a block address is no segment.cargo test -p victory-gpu --lib: 112 passed; with--features diagnostics: 120 passed.cargo clippy -p victory-gpu --all-targets -- -D warnings, with and without--all-features: clean.Made with the help of an AI.