A Sessions poll lists every Codex day folder and Claude Code project.
The few rooms given back were shared by all of them, so a small folder's
room went to a large one and was grown again, entry by entry, on every
poll: 78 MB of 40 unchanged polls with the real page's X-Magpie-Had, the
largest single site. Each folder now keeps the listing before its last,
cleared, as its own room (keepSpare), inside the same keptEntries bound;
the shared rooms are left for folders seen the first time.
Run on mote (M5 Pro, macOS 27), with a copy of the real accounts:
- go test ./internal/dirent ./internal/sessions: ok.
- TestListingsOfDifferentSizesMadeOnce (new): five folders of 1 to 600
files read ten times allocate under 64 KB. Broken by hand (taken never
hands back the spare): 394,808 bytes, red.
- 40 /api/sessions polls with X-Magpie-Had, real history (~23k session
files): 282 MB allocated at v0.1.3492's code, 208 MB with this; the
dirent.entry append is gone from the profile.
Not changed: distinctOf's slice (1.6 MB a poll). Holding it would keep
as much resident as it saves in garbage.