Skip to main content

Setup ZRAM, Z is for compression in Linux!

Setup ZRAM using zram-generator in Arch Linux.

 

Recently many Linux Distro's started offering Zram as an option during install or as default Swap type to supplement low-end hardware devices.

below is the small excerpt from Wiki, 

after reading several articles i was very much interested to try it and see if this really makes a difference when compared to separate Swap partition.

earlier i posted how to easy install Arch Linux using archinstall script, which too offered Zram feature for swap.

after spending some reasonable time with Opensuse 15.4 KDE which was a rock solid experience, i was waiting to try Gnome 43, i had these options either wait for Fedora 37, upgrade Opensuse Leap to Tumleweed or try Arch Linux. Gnome 43 was made available in Arch Linux a bit earlier compared to latter, so i decided to give it a try but unfortunately archinstall script was broken, this is when i followed Arch wiki for installation and was successful with installation.

i will share the step by step installation in separate Post as its bit time consuming.

The easiest way to set up zram is by installing package Zram-Generator.

zram-generator

open this file as Sudo with a text editor of your choice.

/etc/systemd/zram-generator.conf

usually most of the articles suggest you to enable half of the ram size as swap.

like ram/2 etc.. here i want zram as same size as my systems physical ram i.e 8G.

so i entered just ram.

 

after saving the file, re boot the system.

Observations:

unlike swap, Zram will only be used if your Physical memory runs out. we can put it in other way as zRAM will only get used if it's needed, so enabling it will have no effect if you don't need it.my ZRAM consumption was always at ~300 to 400Kb when surfing.

Reduced HDD clicking noises, with Swap partition i always had swap consumption at ~500M to 1 G of space even if we have free space on Ram based on how the swapiness is set(Swap tendency). which made frequent/increased read write operations on HDD.

running virtual machines with zram was quick and responsive than separate swap partition.

as you can see from below snap zram will pitch in only when needed and system was stable and no lag was noticed.

 

Zram is definitely a best add on to improve system performance.


Comments

Popular posts from this blog

Debian 11 Bullseye setup for home user.

    Debian 11 bullseye post install. Why Debian? I Choose Debian because i like to use an independent Distribution. Debian runs smooth on my personal laptop and it makes me nostalgic. i have tried a huge list of Distro’s but always came back for Debian as it runs smooth on my laptop’s hardware.

elementary OS 6.1 Experience.

  Hello! In this post i will be going to share my experiences with Elementary OS, i tried this OS long back i remember its code name was jupiter. it was a pleasant and new experience visually but was very buggy in terms of file manager, Panel,Apps etc... i thought of giving it a second try, so lets see..