This script will enable ZRAM on a Raspberry Pi
Install RPI_ZRAM from your Raspberry Pi's shell promt:
sudo wget -q https://git.io/ -O /tmp/rpizram && bash /tmp/rpizram The installer will complete the steps in the manual installation (below) for you.
Download the script and copy to /usr/local/bin/ folder
sudo wget -O /usr/local/bin/zram.sh https://raw.githubusercontent.com/puregrain/rpi_zram/master/zram.sh
make file executable
sudo chmod +x /usr/local/bin/zram.sh
edit /etc/rc.local file to run script on boot
sudo nano /etc/rc.local
add line before exit 0
/usr/local/bin/zram.sh &
run the script to start your RPI_ZRAM sudo /usr/local/bin/zram.sh
Use top, htop or atop. Which ever you prefer to view the swap memory in action or a simple free -m will do the trick
free -m That command should output something like: ... total used free shared buffers cached Mem: 925 900 24 11 17 810 -/+ buffers/cache: 72 853 Swap: 1025 0 1025 ...