Generally the recommended swap space is double the RAM size. If the RAM size is less than or equal to 2 GB, then the size of the swap = 2 X RAM size. If the RAM size is more than 2 GB, then the size of the swap = 2 GB + RAM size.