Skip to content

Expanding RAM with swapfile

Bùi Minh Đức edited this page Feb 22, 2024 · 13 revisions

Warning

Welcome to the danger zone! Before proceeding, please keep in mind that tempering your phone's system will void your warranty and potentially render it unbootable if done incorrectly. PROCEED WITH CAUTION AND AT YOUR OWN RISK. It's recommended to back up your data first.

KaiOS, being the successor of Firefox OS, relies on the Gecko browser engine to run apps written in light-weight web technologies. It runs quite efficiently most of the time, despite having as little as 256MB of memory.

But in rare cases, as with other operating systems, the phone can handle as much before it starts killing system processes to avoid RAM overflow. To overcome this constraint, KaiOS pulls the Linux trick and compresses some of the RAM data into a zRAM image that resides within the RAM itself. While the compressed zRAM is faster as it directly uses the RAM, it takes up about half of its space, leaving just the other half for active tasks.

Creating a swapfile on your phone's internal storage and direct the system to use that swapfile instead of built-in zRAM would free up that half of your RAM, leaving room for more processes and possibly make the phone faster and more capable—though you'll have to trade off a tiny degradation in speed, some storage space and storage chip longevity.

Disabling the Low Memory Killer daemon

Working on it...