I've dual-booted my laptop with Windows 10 and Ubuntu 18.04. While installing Ubuntu, I created a swap space of 15GB. My laptop has 8GB RAM. I hadn't noticed earlier, but now that my system is running out of memory, I noticed that System Monitor shows only 1.1GB swap. Turning off swap and turning it on doesn't help either. What is happening here? How can I fix it?
PS: I don't know if it matters. Initially I had tried to disable swap altogether. I followed this answer and set swappiness to 10. Now I've changed it back to the default value 60.
Edit1:
Adding content of /etc/fstab
$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/nvme0n1p7 during installation
UUID=3f9f3cd3-acfb-47a8-aff2-fac6a7405e02 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=B827-57AB /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
# (identifier) (location, eg sda5) (format, eg ext3 or ext4) (some settings)
UUID=3a70fe9d-3ffc-4e4e-b7b1-d94f2dbe0bbd /home ext4 defaults 0 2
Following KGIII's comment, I fixed it as follows
Check if
/swapfile
is being used instead of swap partitionNow, to change swap from using
/swapfile
to partition, I followed this blog. Although it does the reverse, the required commands are available.Turn off
/swapfile
Edit
/etc/fstab
file to use swap partition instead of/swapfile
. Commented existing line and added new line. UUID can be obtained from gparted (right click on swap partition and selectinformation
)Format the swap partition
Set swap to use the partition