Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content

Fairphone 3+ / FP3+: 50% zram feels like too much for 3.5 GB

  • /e/OS version: 2.7
  • Device model(s): FP3+

The problem

I'm quite sure, that my FP3+ runs much more fluent since I decreased zram in /vendor/etc/fstab.qcom from 50% zram to 25 %".

Steps to reproduce

Use Firefox / Fennec with many tabs opened on a FP3+.

Technical details

FP3(+) has 3.5 GB of usable system memory.

A 50 % zram setting creates a swap area which is about 1700 MB in uncompressed size. zram's compression ratio varies by the type of data currently stored in memory. If there are a lot of images for browsing the web, the compression ratio can be quite bad. But usually the ratio is around 2:1. So for 1700 MB uncompressed data it can be assumed that 850 MB of memory are being used.

Determining the optimal zram size can be a quite individual task. And I'm not very familiar with how Android manages memory. So I can't say much about the actual facts here. Mostly I can only report, that it just feels much better with 25 % zram instead of 50 %.

I've some experience with zram on Debian-Linux. And it's usually a good rule of thumb, to have all currently actually needed data in directly accessible memory, not just in zram. So I actually think it's not a good idea to set the zram to some percentage value, but instead configure it to a value derived from whole_memory - currently_needed_memory. This increases allows to have more inactive graphical apps loaded in the background, while keeping up the performance of the currently running app.

Processes can't access data in zram! It must always be decompressed first. It's usually fine if graphical apps currently in background are moved into zram. But the currently used graphical app plus all needed background processes (Linux kernel, system services, ...) should stay in the directly accessible memory! Else you'll experience a lot of (de)compression "swapping" pauses while using the app graphically in foreground.

For the FP3 the estimated 850 MB memory usage for zram reduces the directly accessible memory from 3500 MB to 2700 MB. And it seems, that this can become too few for Firefox plus the processes running in background. So data is (de)compressed all the time while you just stay in Firefox.
(Firefox / Fennec version 128 seams to easily use 1 GB of memory)

Edited by kolAflash