--- title: Memory section: Operations order: 101 summary: What HUD holds in memory and how to measure it. --- What HUD holds is bounded by what's on screen. What's open doesn't grow it. ## Server Every in-memory cache is bounded by entries and by bytes. `HUD_CACHE_MEMORY_BYTES` is shared out like this: - joins' records get nine 32nds - lexicons get three sixteenths - DID documents and queries' answers get an eighth each - counts get five 32nds - the rest get a 32nd each HUD weighs each value as it keeps it. It doesn't keep a value that weighs more than a quarter of its cache's share. HUD keeps audio and video on disk (`HUD_BLOB_CACHE_BYTES`). It streams images through and never holds them whole. Sign-in's pending requests and client documents are capped by count. `hud serve` logs each cache's entries and bytes as it stops (`caches at shutdown`). ## Workspace A tile keeps what it read, and never makes it deeply reactive. It draws it only while its column is within a screen's width of what's in view on the tab on screen. Farther away, or on a tab out of sight, the tile's body is empty and its scroll is kept. As it comes near, the tile draws again from what it read, without asking again. The iOS app keeps a tile's scroll the same way when its view is made again, as switching canvases does (iOS 18 and later). A player's music goes on in the page's one `