-
Notifications
You must be signed in to change notification settings - Fork 4
Expanding RAM with swapfile
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.
Being the successor of the discontinued Firefox OS, KaiOS relies on the Gecko browser engine to run apps based on light-weight web technologies. As such, it delivers comparable performance to other fully-featured operating systems, despite having as much as 1GB of memory; and unlike basic OSes like S30+, it can also handle multiple processes at once.
However, likewise with other OSes, there's a limit on how much the phone can handle before it starts killing processes to avoid memory overflow; by default it nearly reaches that limit, with the Linux kernel already takes around 200–250MB. To resolve this issue, KaiOS 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 reserves about half the space, leaving just the other half for active tasks. Once the memory is full, a daemon called Low Memory Killer kicks in and terminates processes in the order of priority.
Creating a swapfile on your phone's internal storage and direct the system to use the swapfile instead of in-built zRAM frees 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.
Working on it...
This documentation page is written on the courtesy of the BananaHackers team, 2018–present.