How much swap memory is enough?

In Linux, and in other Operating systems is the same, a swap file memory or partition is an extension of the real physical memory. The operating system (Linux in this case) will store in the disk segments of the physical memory that it is not being used at the time, to free memory for new applications that may need it.

Memory is very cheap today, and it is not difficult to have 8 GBytes of physical memory in any Desktop or even Laptop.

So, are you still need swap memory? Probably not, and almost sure not a swap memory size that doubles the physical memory as it was in the old days.

I think, if you have from 8 G Bytes or more, you do not really need swap memory at all, if you have from 4 G Bytes or less, maybe 1 Gigabyte of swap would be fine, 2 at the most. That applies for Desktops or servers.

If you are running a VPS with less than 1 Gigabyte or physical memory, you may want to equal the size of the swap to the size of your physical available memory.

If you are installing Linux on a laptop, you will have to equal the size of the swap memory to the physical memory in order to the be able to suspend to disk. When you suspend to disk all RAM is written in the swap area and then the power is turned off, if there is not enough space to allocate all physical memory in the swap memory the process will fail.

Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material
for any purpose, even commercially.

The licensor cannot revoke these freedoms as long as you follow the license terms.

Under the following terms:

Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.

No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.