Jump to content

Low RAM usability: Difference between revisions

From postmarketOS Wiki
Link2xt (talk | contribs)
m Add nokia n900 link
Iourine (talk | contribs)
Configuring ZRAM: As of kernel 5.16, modprobe zram needs an argument - number of devices to be created. zramctl does not create them but only configures the existing ones.
Line 31: Line 31:


==== Configuring ZRAM ====
==== Configuring ZRAM ====
If ZRAM is built as a module, then you must load it first:
If ZRAM is built as a module, then you must load it first, specifying :
  # modprobe zram
  # modprobe zram "num_devices=NUMBER"


Create a ZRAM device with <code>zramctl</code>, replacing <code><size></code> with the size of your physical memory, and <code><n></code> with the number of CPUs available:  
Configure a ZRAM device with <code>zramctl</code>, replacing <code><size></code> with the size of memory that you'd like dedicate to it, and <code><n></code> with the number of CPUs available:  
  # zramctl -f -s <size> -t <n>
  # zramctl -f -s <size> -t <n>
Make it a swap device:
Make it a swap device:

Revision as of 14:40, 11 April 2022

While postmarketOS has been historically used on devices with as little as 256MB RAM (see Nokia N900), modern usage on less than 2GB RAM can be challenging.

Interfaces

UIs can be categorized as follows, considering at least some space left to running applications.

  • LXQt, i3, sway for 256MB+ RAM
  • MATE, Xfce4 for 768MB+ RAM.
    • In both cases, make sure to disable the "compositing" window manager feature from settings to achieve much higher performance on older processors.
  • Phosh, KDE Plasma for 1GB+ RAM.
    • KDE Plasma Desktop should be used in "Xorg mode" for lower resource consumption
  • GNOME for 2GB+ RAM

Browsers

Not much, since latest versions of both Firefox and Chromium are intensive on RAM usage. Netsurf is arguably still the best choice for low-power devices, but text-based browsers are ultimately the best choice for very limited devices.

Apps

For basic GUI utility apps, the set of CoreApps (Qt5) may be a good choice to minimize the memory footprint.

Workarounds

There are some ways to workaround the limited size of physical memory.

ZRAM

A kernel module that compresses memory to allow for fitting more data onto physical memory. This however consumes CPU cycles to do the compression, so it is a tradeoff between memory and CPU. With that considered, it is still usually much better than running out of memory and having to deal with the instant degradation of performance caused by that.

Kernel Configuration

CONFIG_ZRAM must be enabled, either built-in or as a module.

Configuring ZRAM

If ZRAM is built as a module, then you must load it first, specifying :

# modprobe zram "num_devices=NUMBER"

Configure a ZRAM device with zramctl, replacing <size> with the size of memory that you'd like dedicate to it, and <n> with the number of CPUs available:

# zramctl -f -s <size> -t <n>

Make it a swap device:

# mkswap /dev/zram0

Then activate it:

# swapon /dev/zram0

It may also be a good idea to give it a high priority using --priority if there are disk-based swap devices in use.