Swap size recommended settings from Ubuntu Official documentation
https://help.ubuntu.com/community/SwapFaq
RAM No hibernation With Hibernation Maximum
16GB 4GB 20GB 32GB
You need 4Gb or 20Gb of swap space. Not more.
The priority makes sense when there is more than one swap area.
Not used in your (1 swap area) case
You can tune the swapping behavior with swappiness
The same Documentation FAQ tells about swappiness,
see: https://help.ubuntu.com/community/SwapFaq#What_is_swappiness_and_how_do_I_change_it.3F
Rebuild your swap setup:
## Delete old swapfile
sudo swapoff -a
sudo sudo rm /swapfile
## Create new swapfile (choose one according to hibernation use)
# sudo fallocate -l 20g /swapfile ## If hibernation have to be used
sudo fallocate -l 4g /swapfile ## If no hibernation use is planed
sudo chmod 600 /swapfile
sudo mkswap /swapfile
## Enable new swapfile
sudo swapon /swapfile
## /etc/fstab check
# since /swapfile was used, a line should be present in /etc/fstab file
# search for and check '/swapfile swap swap defaults 0 0'
## Show swap settings and usage
swapon -s
free -h
swappiness
, take a look at https://askubuntu.com/questions/103915/how-do-i-configure-swappiness . – mook765 Aug 04 '19 at 15:50