e8156927df
A row of `photos` kept the frame's own FileSystemFileHandle, and reading the catalogue handed them all to the page at once. Measured on a catalogue of 504290 frames, 458103 of them with a handle, opening the library left the JS heap at 133MB while the browser process held 5.7GB and the renderer 2.1GB: handles are not the page's heap, so nothing ever asked the collector to run, and the rescan's own reload of the catalogue every thirty seconds piled one such reading on the next until the tab was out of memory. No row keeps a handle now. The catalogue is read a few thousand rows at a time — the four and a half gigabytes of live handles came from asking for all of them at once — and a frame's file is asked of its folder's handle when it is drawn or opened, `fileHandleFor`. `reconnectPhotosForFolders` no longer writes handles back into the frames, which is what put them there. 504290 rows read in chunks peak at 1.4GB and settle at 1.1GB, against 8.0GB in one read before.