September 26, 2022

COSFONE

Networking, PBX, IT, DIY Solution

Ubuntu supports running on Raspberry Pi 4 with 2GB RAM

3 min read

Ubuntu supports running on Raspberry Pi 4 with 2GB RAM

 

Ubuntu supports running on Raspberry Pi 4 with 2GB RAM.

Ubuntu further lowers the hardware threshold and supports running on Raspberry Pi 4 with 2GB of memory.

Ubuntu already supports the 4GB and 8GB RAM versions of the Raspberry Pi 4 Model B (supported since Ubuntu 20.10).

Now the Ubuntu team plans to lower Ubuntu’s hardware threshold even further , allowing the upcoming Ubuntu 22.04 LTS release to run on a Raspberry Pi 4 with only 2GB of RAM .

 

Ubuntu supports running on Raspberry Pi 4 with 2GB RAM

 

However, it is very difficult to make a complete Linux system like Ubuntu run properly on hardware devices with too low memory, so how does Ubuntu do it? Then have to mention a Linux kernel feature called zswap.

 

Before mentioning the zswap feature, let’s talk about Linux’s virtual memory file: swap file. Any type of Linux system will allocate a swap file on the hard disk or SD card , which acts as a kind of overflow of RAM (running memory).

When the system’s available memory is insufficient, the swap file will cache some pages and release the memory to the active memory.

Process usage, so that the system can continue to work even when almost all RAM is used up. (In addition, the Win 10 system disk also has a swapfile.sys file)

 

However, the performance of using swap files is not as good as using RAM directly, because accessing the hard disk is too slow compared to using memory, so the Zswap feature was introduced in the process.

 

zswap is essentially a compression tool.

When a process is about to be moved into a swap file, zswap compresses it and checks to see if the new compressed pages still need to be moved, or can be left in RAM.

If the compressed page can be left in RAM, decompress it when it is accessed again. Unpacking a “zswap” page is much faster than accessing a swap file, so the zswap feature is ideal for low-memory hardware devices.

 

How to enable this feature?

Since Ubuntu supports zswap by default, you can open a terminal emulator with a simple one-line command

 

sudo sed -i -e 's/$/zswap.enabled=1/' /boot/firmware/cmdline.txt

Then restart the board to enable the feature.

 

In fact, zswap is only one of the means to lower the threshold of Ubuntu hardware.

in addition to a series of features such as z3fold and lz4 compression, these optimizations will be included in the April release of Ubuntu 22.04 and will be enabled by default on all Raspberry Pi 4 devices.

 

 

Ubuntu supports running on Raspberry Pi 4 with 2GB RAM


Leave a Reply

Copyright © All rights reserved. | Newsphere by AF themes.