Activating ZRam on Linux distributions
Hey guys!
This tutorial's for those of us on GNU/Linux, are low on physical RAM, and have flash storage (especially for SBCs like the Raspberry Pi). ZRam is a kernel module that compresses RAM content to save space for more RAM intensive processes. It acts much like a swap file/partition, where RAM pages are "swap"ped in and out to free up RAM.
The overall process is pretty simple, involving just a few commands and no extra packages.
Cheers!
Technohacker
This tutorial's for those of us on GNU/Linux, are low on physical RAM, and have flash storage (especially for SBCs like the Raspberry Pi). ZRam is a kernel module that compresses RAM content to save space for more RAM intensive processes. It acts much like a swap file/partition, where RAM pages are "swap"ped in and out to free up RAM.
The overall process is pretty simple, involving just a few commands and no extra packages.
- Load the zram kernel module
$ sudo modprobe zram - Use zramctl to get an available zram device
$ sudo zramctl --find --size <size in megabytes>M
Example: $ sudo zramctl --find --size 1024M # For 1GB - Create swap on the created zram device
$ sudo mkswap <device name printed by zramctl> - Enable swap
$ sudo swapon <device name printed by zramctl> - Profit!
Cheers!
Technohacker
Comments
Post a Comment