Increase your Raspberry Pi RAM using ZRam!
Is your Raspberry Pi running out of RAM quickly? Have you searched found a way to upgrade your Raspberry Pi RAM? I didn’t think so. ZRam is basically compressed memory similar/same to swap memory. This tutorial is based on NovaSpiritTech’s ZRam script, so credits to him.
- A Raspberry Pi 2 or better
- Raspbian on 8GB Micro SD card (minimum)
- Keyboard, mouse, power supply, monitor/TV
Downloading the Script
- Open Terminal
- Download the ZRam Script
sudo wget -O /usr/bin/zram.sh https://raw.githubusercontent.com/novaspirit/rpi_zram/master/zram.sh
- After it is downloaded, we need to set user executable permissions on it
sudo chmod +x /usr/bin/zram.sh
- We now need to edit the rc.local file
sudo nano /etc/rc.local
- Add this before exit 0
- Press Control + X, Y, Enter.
- Close Terminal and reboot your Pi. The script should be working.
You can use Conky to see if the extra RAM has been added. If you need to install Conky, use this tutorial.
There is a small catch to this though. Compressed RAM takes more CPU cycles causing a reduction in CPU processes. This may slow down your system if it needs to do a CPU intensive task. If you have any issues, post the problem in the comments, and I will try and help you.