How to enable swapfile on your rpi board under ubuntu

i also found this as well…
all you need do for this is
apt install zram-config
dont bother changing or editing the rc.local file you can leave it or delete it…

`sudo nano /usr/bin/init-zram-swapping`

and
at line

totalmem=`LC_ALL=C free | grep -e "^Mem:" | sed -e 's/^Mem: *//' -e 's/  *.*//'`
mem=$(((totalmem / 2 / ${NRDEVICES}) * 1024))

change 1024 to 2048 it will double its size to 4 gig approxx… i set it to 4096 and my total ram listed including swap was 12 gig…i am using a m:2 sata 6gb hdd so if your using an sd card be careful how you change this value…

also scroll down you will see a line that has its priority it states " P 5 " you can change this to what order it is i set mine to 1 just for a test…
so now i checked my system monitor and it states 8.3 gig of swap memory…