Increase your Raspberry Pi RAM using ZRam!

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.

Things needed:

  • A Raspberry Pi 2 or better
  • Raspbian on 8GB Micro SD card (minimum)
  • Keyboard, mouse, power supply, monitor/TV

Video Tutorial:

Downloading the Script

  1. Open Terminal
  2. Download the ZRam Script
sudo wget -O /usr/bin/

Configuring Script

  1. After it is downloaded, we need to set user executable permissions on it
    sudo chmod +x /usr/bin/
  2. We now need to edit the rc.local file
    sudo nano /etc/rc.local
  3. Add this before exit 0
    /usr/bin/ &
  4. Press Control + X, Y, Enter.
  5. 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.


Check out NovaSpirit’s website!

4 Replies to “Increase your Raspberry Pi RAM using ZRam!”

  1. Yes, it works as described. Needed a reboot as you indicated before Conky would show the change. Haven’t noticed a slow down in computer speed.

    1. One other drawback I have seen (found on forums) that since it is sort of like swap, it uses more write cycles on your SD card. This means that the longevity would decrease. I use a HDD so it is not much of an issue there.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.