A driver's compiler frees what it took when the making returns, and glibc's malloc keeps
what a thread frees in that thread's arena, so a process whose threads each made a large
pipeline holds each one's compile peak as free heap until it ends. On an RX 7900 XTX (RADV,
Mesa 26.2.6) a kernel of 200,000 fused multiply-adds with 600 values live, made as 9
VkPipelines, took the process's resident set from 105 MiB to 7.3 GiB; malloc_trim handed
back all but 327 MiB, and the VkPipelines and live VkPipelineCaches held about 170 MiB of
that (a probe, m3-max-24140). A guest's Blender run on the XTX grew about 0.5 GiB per large
compute variant until its VkDevice went, and died at its cgroup's cap.
Now a large making (65,536 SPIR-V words or more, the makings pipeline/compile_memory.rs
already holds words for) whose return leaves glibc more than 256 MiB free (mallinfo2's
fordblks, every arena's) calls malloc_trim(0) on its thread before it gives its words back,
counted in the new WorkCounts::heap_trims. It trims glibc's arenas process-wide; on any
other allocator nothing is called. The trade, in compile_memory.rs's docs: the next large
making faults its working set in again (about 1 s per 3.5 GiB).
For a consumer: WorkCounts gains a field (api_signatures.tsv blessed).
Test: tests/heap_trimmed.rs (m2v_gpu, Linux GNU): three large makings of one kernel keep
the resident set within 1 GiB of where it began, and count a trim.