The SSH App opens one session to a shell, over libssh (LibSSH-ESP32 5.10.0) on mbedTLS. A server is trusted the first time on its fingerprint, and a changed key is a warning with Cancel selected. The password is typed each time and kept nowhere; or the device makes itself an Ed25519 key, whose public half is shown, written to /ssh/id_ed25519.pub and printed by `ssh status`. lib/term is the terminal: what a shell, less, top, nano and vim send, with sixteen colours, scroll regions, the alternate screen and 100 lines of scrollback. Five text sizes with Ctrl and + or -, from 60x20 to 26x8, told to the far end. The session goes on when the App is left; SSH shows in the Status Bar. `ssh user@host` in the Shell opens the App. Also: - Keys that aren't characters carry Shift, Ctrl and Alt. The terminal needs it, and it makes Ctrl+Fn+up/down in a note and Shift+Tab in Gemini work from the real keyboard. - IRC doesn't try to connect under 60 KB free: started with a session open, its TLS handshake took the heap down to 236 bytes. - libssh's own curve25519 is left out of the build (scripts/libssh_filter.py): libsodium's has the same names. Costs 292 KB of flash and about 50 KB of heap while a session is open; not started under 75 KB free. Docs: guide page, how-to, FAQ, home page, Status Bar, SD card folders, the memory how-to, README, glossary, N1 notes with Q254 to Q266 and the checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
2.1 KiB
+++ title = "When a connection says "not enough memory"" description = "The device has about 107 KB to share, and a secure connection takes about 52 KB. How to free some, and why it happens." weight = 8 [extra] tag = "Memory" +++
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: close the SSH session. Or an update check or install makes IRC disconnect for a moment.
What to do
- Stop IRC. In the IRC App, type
/quitand press Enter. IRC disconnects and stays disconnected until you type something again, so it does not take the memory back. - Try again. A Gemini fetch needs 55 KB free before it starts.
- 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 ends | 50 KB: IRC waits while it is open, and it doesn't start under 75 KB free |
| A note open in the editor, whatever its size | 17 KB |
| Sharing the card with a browser | 13 KB |
| The Shell | 7 KB |
| The VPN tunnel | under 2 KB |
| Showing a PNG | one free block of 32 KB, while it is decoded |
Why it happens
The Cardputer's chip has no extra memory (no PSRAM). A secure (TLS) connection costs about 52 KB at its peak, and IRC's own connection holds about 40 KB of the 107 KB there is. A second secure connection on top does not fit, so the firmware refuses it 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.