A process's first library over 8 KiB took a staging window of 64 MiB and kept
it for the process's life. On a busy desktop on the RTX 5080 host, nine
processes held 576 of the 731 MiB of the region outside WindowServer's
reserve that way (mediaanalysisd held nothing else), so the region ran out at
41 processes. From there, libraries, buffers and queue rings came back nil,
and Games, Photos, Photo Booth, Maps, the Dock's extras, NotificationCenter
and WebKit's GPU process crashed.
The window is now made for one stream and sized to its library: as few
chunks of at most 32 MiB as hold it, split evenly in whole pages, and a
second block only where there are two or more chunks. It goes back to the
region once the host has acked every chunk. Where the region refuses it,
smaller chunks are asked for, down to a page, so a library is made while any
room for three pages is left. A window whose chunk the host never acks is
kept, so nothing the host may still read is given out again.
The stream moves to RgfxLibraryStream.cpp, so the serialiser check covers it
against a host of its own: the shapes, the fallbacks and their bytes and
order, the window given back, and one kept when an ack never comes.