How Much Swap Should I Use With 64 GB of RAM?
Asked by
carry-on-only
I'm setting up a Gentoo system with 12 hardware threads and 64 GB of memory. With that much RAM and a relatively modest thread count, is swap still useful or necessary? If it is recommended, roughly how much should I allocate, and are options like zram or zswap worth considering?
Answers
You probably wonโt need swap during normal use, but thereโs little downside to setting aside a few gigabytes. Swap can prevent an occasional memory spike or runaway process from immediately crashing the system. The machine may become very slow while swapping, but staying online gives you a chance to diagnose and fix the problem.
Reply to this answer
The exact amount is debatable, and it depends on whether you need hibernation. Without hibernation, a modest swap file or partition is generally enough for a system with 64 GB of RAM. Around 4โ8 GB is a reasonable starting point, assuming you arenโt regularly running memory-heavy workloads.
Reply to this answer
Swap can also be provided through compressed memory options such as zram or zswap. These can help absorb short-lived memory pressure without immediately relying on disk storage. A setup with 8 GB of swap alongside zswap is one practical approach, but it isnโt mandatory if your workloads never approach the available RAM.
Reply to this answer
Add your answer
Answers are reviewed before publication.
carry-on-only: That makes sense. Iโd rather have the system slow down temporarily than crash outright.