How does Linux calculate swap?
Answer
If RAM is more than 1 GB, swap size should be at least
equal to the square root of the RAM size
and at most double the size of RAM. If hibernation is used, swap size should be equal to size of RAM plus the square root of the RAM size.