You can’t edit a binary paging file unless you’re using a hex editor. Not recommended.
Your swap is a paging file, as opposed to a partition on disk, so those mount settings in Webmin are probably fine. Are you getting different info from Webin than what these commands tell you?
cat /proc/swaps
swapon -s
fdisk -l
Try a few things in a terminal. Since your swap is full, might as well clear it before going further.
swapoff -a
Wait a few seconds before running
swapon -a
View your swappiness setting. It’s probably 30 or higher on a 4gb VPS.
cat /proc/sys/vm/swappiness
Try setting it to 10 or below.
sysctl vm.swappiness=10
The setting is active at this point but resets after the next reboot. For persistant swappiness use an editor to add the value to sysctl.conf.
nano /etc/sysctl.conf
vm.swappiness=10
While you’re in there add this setting too if it’s not there already.
vm.overcommit_memory=1
Save the file and run
sysctl -p
After the next reboot the new setting should still be there.
cat /proc/sys/vm/swappiness
10
Webmin’s graphs are useful but these monitoring commands will give you detailed numbers in a more timely fashion.
free -g
free -k
free -m
top
vmstat
vmstat 1 5
I still think your problem isn’t solved by increasing swap size, but maybe I’m wrong.
Last time my swap partition filled up the problem turned out to be Fail2Ban. There’s no simple way to flush Fail2Ban for a fresh start but there’s a way to zap its database.
ClamAV uses a ridiculous amount of RAM because of gigantic signature databases that need to be active all the time (in swap). If SpamAssassin loads big RBLs on a busy mail server it needs a place stash them (swap). Low-volume mail systems don’t need all that, but if you’re hosting email for customers you don’t have the luxury of turning off these inefficient services. Just keep an eye on mail server defenses because sometimes they’re offensive.