linux swap memory limits – reference guide

Amount of system RAM Recommended swap space Recommended swap with hibernation
less than 2 GB 2 times the amount of RAM 3 times the amount of RAM
2 GB – 8 GB Equal to the amount of RAM 2 times the amount of RAM
8 GB – 64 GB 0.5 times the amount of RAM 1.5 times the amount of RAM
more than 64 GB workload dependent hibernation not recommended
Amount of RAM Recommended swap space
≤ 2GB 2X RAM
2GB – 8GB = RAM
>8GB 8GB