zram News - CNX Software - Embedded Systems News

Reminder: enable ZRAM on your Linux system to optimize RAM usage (and potentially save money)

ZRAM zstd compression ram sticks

With the price of RAM getting out of control, it might be a good idea to remind Linux users to enable ZRAM so they can get better performance without upgrading memory, or save money on their next single board computer by selecting a board with the right amount of memory.

I had already written about the subject when I enabled ZRAM on a ODROID-XU4Q in 2018 using zram-config, and did the same on my Ubuntu laptop at the time. In recent days, I found Firefox crashing often due to running out of memory on my system with 16GB of RAM, and the Linux 7.0 release reminded me about ZRAM, since there were some related changes. So I decided to check the current swap configuration on my Ubuntu 24.04 laptop:

Linux 7.0 Release – Main changes, Arm, RISC-V, and MIPS architectures

Linux 7.0

Linus Torvalds has just released Linux 7.0 on LKML: The last week of the release continued the same “lots of small fixes” trend, but it all really does seem pretty benign, so I’ve tagged the final 7.0 and pushed it out. I suspect it’s a lot of AI tool use that will keep finding corner cases for us for a while, so this may be the “new normal” at least for a while. Only time will tell. Anyway, this last week was a little bit of everything: networking (core and drivers), arch fixes, tooling and selftests, and various random fixes all over the place. Let’s keep testing, and obviously tomorrow the merge window for 7.1 opens. I already have four dozen pull requests pending – thank you to all the early people. Linus This follows the Linux 6.19 release about two months ago, which brought us PCIe link encryption and […]

Ubuntu 22.04 LTS to leverage zswap to run on Raspberry Pi 4 with 2GB RAM

Raspberry Pi 4 2GB Ubuntu 22.04

Canonical used to recommend Raspberry Pi 4 with at least 4GB RAM to run Ubuntu Desktop, but Ubuntu 22.04 LTS should run more smoothly on the Raspberry Pi 4 2GB as the company has enabled zswap by default to allow the Linux operating system to run better on systems with less memory. Canonical explains that zswap is essentially a compression tool. When a process is about to be moved to the swap file, zswap compresses it and checks whether the new, smaller size still needs to be moved or if it can stay in your RAM. It is much quicker to decompress a ‘zswapped’ page than it is to access the swap file so this is a great way of getting more bang for your buck from systems with smaller amounts of RAM. The good news is that you don’t even need to wait for Ubuntu 22.04 LTS to come […]

Running out of RAM in Ubuntu? Enable ZRAM

htop-zram

Whenever I ran out of RAM on a Linux system, I used to enable swap memory using the storage device to provide an extra bit of memory.  The main advantage is that it’s does not require extra hardware, but come at the cost of much slower access, and potential issues or wear and tear, unless you only use it temporary. This week-end, I compiled Arm Compute Library on ODROID-XU4Q board, and the first time it crashed because the system ran out of memory, so I enable swap on the eMMC flash module to restart and complete the build successfully. However, I was told it would have been better to enable ZRAM instead. So what is ZRAM? Wikipedia explains: zram, formerly called compcache, is a Linux kernel module for creating a compressed block device in RAM, i.e. a RAM disk, but with on-the-fly “disk” compression. So it’s similar to swap, expect […]

Linux 3.15 Released

Linus Torvalds announced the release of Linux Kernel 3.15 last Sunday: So I ended up doing an rc8 because I was a bit worried about some last-minute dcache fixes, but it turns out that nobody seemed to even notice those. We did have other issues during the week, though, so it was just as well. The futex fixes and cleanups may stand out, but as usual there’s various other random fixes since rc8 in there too: mainly drivers (drm, networking, sound, usb etc), networking, scheduling and perf tooling. But it’s all been fairly small and quiet, which *may* of course be due to the fact that last week was also the first week of the merge window for 3.16. That might have distracted some developers. I’m not entirely convinced I liked the overlap, but it seemed to work ok, and unless people scream really loudly (“Please don’t _ever_ do that again”) and give good […]