Around the issue of creating swap is not the first year of heated discussions. Let's abstract from it and we will consider that the area of reserve memory after all is necessary, and people often use not the swap file, namely the partition.
By default, Linux starts to access swap if the RAM is 40% or more full. The speed of reading data from the hard disk (namely, there is an area of backup memory) is much lower than the speed of access to RAM, and therefore the system begins to slow down. And to score less than half of the same 4 GB of RAM is very simple - just run any modern browser.
First, let's check if our Linux Mint really uses virtual memory, is when operational is filled with exactly 40 percent:
Then we are free to correct the number. I usually change the value so that my system accesses swap only after cluttering 90 percent or more of RAM:
Now we can check the value in /proc/sys/vm/swappiness again if we want to verify the effectiveness of the previous command:
sudo sysctl -w vm.swappiness=10
However, I cannot advise anything about the optimal value in your particular case. I advise you only to experiment with different numbers to achieve a perfect balance. They are usually in the range of 10 to 30.
May the Force be with you,