how to enable swap memory in ubuntu code example Example: ubuntu turn off swap sudo swapoff -a && sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab