How-tos · Memory

When a connection says "not enough memory"

The device has about 107 KB to share, and a secure connection takes about 40 KB. How to free some, and why it happens.

What you see

Opening a Gemini page fails with not enough memory: stop IRC or retry. Or SSH says Not enough memory: close IRC or a Gemini page, or IRC says not enough memory (40 KB free, 60 needed): close SSH, the Scanner or the mesh, or the Mesh App says Waiting for memory. With enough free in all, a connection may still say the largest free block is 12 KB, 17 needed: the memory is there, but in pieces. Or an update check or install makes IRC disconnect for a moment.

What to do

  1. Is Bluetooth on? (B in the Status Bar.) Then nothing secure fits: switch it off in Settings → Network → Bluetooth.
  2. Stop IRC. In the IRC App, type /quit and press Enter. IRC disconnects and stays disconnected until you type something again, so it does not take the memory back.
  3. Try again. A Gemini fetch needs 55 KB free before it starts.
  4. Start IRC again when you are done: type a line in the IRC App, and it reconnects and rejoins its channels.

See it

The System App's Memory view shows free memory, the lowest since the device started, and the largest free block, drawn against the three memory floors (55, 40 and 20 KB). Watch it fall when a connection opens, and recover when it closes.

What the other things cost

Small next to a secure connection, but they add up when memory is already short:

While it is in use
An SSH session, from login until it ends50 KB: IRC waits while it is open, and it doesn't start under 75 KB free
A note open in the editor, whatever its size17 KB
Sharing the card with a browser13 KB
The Shell7 KB
The mesh, in the backgroundabout 16 KB: Settings → GNSS and radio → Mesh off gives it back. It starts only with 32 KB free. With the VPN up, IRC connecting with the mesh on can take the memory very low for a moment
A LoRa capture, or the LoRa Scanner open7 KB more, for its list of 32 packets
The VPN tunnelunder 2 KB
Bluetooth, while it is onabout 50 KB: IRC, Gemini and update checks don't fit beside it. Settings → Network → Bluetooth off gives it back at once
Showing a PNGup to 32 KB while it is decoded, in pieces of 4 KB: it doesn't need one large free block

Why it happens

The Cardputer's chip has no extra memory (no PSRAM). A secure (TLS) connection costs about 40 KB at its peak, and IRC's own connection holds about 25 KB of the 107 KB there is, more for a moment each time a message arrives: up to 16 KB, in one piece. So a connection also needs one free block of 17 KB. When either is short, the firmware refuses early instead of crashing. This is also why IRC steps aside during an update, and why the daily update check waits until IRC is not connected: see Updates.