RAM Compression in the Linux Kernel
ZRAM (also called zRAM and, initially, compcache) is a Linux kernel feature that provides a form of virtual memory compression. zram increases performance by avoiding paging to disk and using a compressed block device in RAM instead, inside which paging takes place until it is necessary to use the swap space on a hard disk drive. Since using zram is an alternative way to provide swapping on RAM, zram allows Linux to make a better use of RAM when swapping/paging is required, especially on older computers with less RAM installed.
Read the full zram block device documentation to learn more about how this works.
How To Use ZRAM in Debian To Get More Usable RAM
I’ve an eight old Q9550 CPU with 8GB DDR2 RAM. I don’t really believe in buying new hardware. So I’ve been using this for about 8 years. :)
Sometimes when I’m using chrome or some other goofy Xorg requiring software which needs a lot of RAM, I find myself running out of RAM and swapping out to disk a lot more.
I started using the ZRAM module in the Linux kernel.
I wrote a little bash script inspired by debian documenation and dropped it inside
Here is the bash script.:
Since I have a Quad Core CPU, I want to create 4 ZRAM devices, one for each CPU core, and I simply use it like this:
You can modify the configuration to suit your needs. For example, lately I started using 2 compressed RAM block devices, 2GB each, intead of 4 devices, 512MB each.
The logs can be found in
Hash’s Desktop (Debian Jessie 8.x GNU\Linux)