Many here (like me) will need a crash course on zRAM and what it does. But for those who already know, and has been playing with it on your Chromebook, here is a good news. Google is planning to enable zRAM by default on all platforms of Chrome OS. “The default swap size is 1.5 x RAM size, but it an be overridden by /etc/default/zram_size.sh”
What is zRAM
zRam is an experimental (staging) module of the Linux kernel. It was previously called “compcache”. zRam increases performance by avoiding paging on disk and instead uses a compressed block device in RAM in which paging takes place until it is necessary to use the swap space on the hard disk drive. Since using RAM is faster than using disks, zRam allows Linux to make more use of RAM when swapping/paging is required, especially on older computers with less RAM installed. (From Wikipedia)
This is another method they are planning to use to make Chrome OS work better, by handling RAM efficiently. There are other linux distributions that can already be tweaked to get better performance.
zRAM on Chrome OS
There are already geeks playing with zRAM on Chrome OS. It needs some commands and some testing to get this working. By making zRAM enabled by default on Chrome OS, they can get things working really easy, and also tweak them to their preference. But for normal users, this just means performance boost, which is always welcome.
Here is the commit log for this change, which gives some additional information.
Enable zram by default.
This change enables zram by default for all platforms. It still allows manual control of zram from crosh.
Before this change, zram was not enabled if the file /home/chronos/.swap_enabled was missing. Now it is enabled with default swap size if the file is missing or empty. It is disabled if the file indicates a size of "0". Otherwise the content of the file specifies the size.
The default swap size is 1.5 x RAM size, but it can be overridden by /etc/default/zram_size.sh.
Before this change goes in, we also need to either end the zram field trial, or change it to behave correctly with the new defaults.
BUG=chromium:218338 TEST=manually tested
Since they are saying that this change is for all platforms, I would expect this to show up on ARM Chromebooks also soon and there, it will shine better.
So, that’s all I have for now about zRAM. If you are a linux geek and got something more to add, drop a comment below!