RAM and swap partitions


Active Member
Jun 7, 2010
This has been intriguing me since some years both for VMs and bare metal PCs.

Unlike Windows, Linux/*nix systems normally use a separate partition for RAM swapping. The thing is, IIRC there has never been a constant best practice "standard" as for how large swap partition should be. It was said years ago that is was in function of the amount of physical RAM installed -with *many* different opinions regarding the actual size-, but now it doesn't seem to matter. Installers of the different Linux distributions around, including Proxmox itself, still propose a swap partition size based on the amount of physical RAM, but actual size depends on each particular distribution!

Linux distributions seem to encourage non-expert users for a swap size always proportional to installed physical RAM. But what if this amount changes, i.e., when escalating the server with more physical RAM? Must I modify the swap partition always whenever I add/remove physical RAM?
And from the previous paragraph, how to know the new size?

Proxmox VE uses a swap size between 4-8GB if it is not set.
This dependence on the available memory this is true.
It is also true that swap is not dependence to memory size. It is dependence on application usage on the host.
Proxmox VE is for virtualization so swapping is generally a bad thing because it slows down your system( incl. all guest).
So swapping is not welcome and only prevention for the OOMKiller.
That is the reason why we use max 8GB swap size, more makes no sense even you have 1TB memory.
  • Like
Reactions: Juertes
But what if this amount changes, i.e., when escalating the server with more physical RAM?

Yes, most commerical Linux distributions recommend the double size of your memory but at most 16 GB. Nowadays, it's also common to use compressed RAM-based swap devices, e.g. zram as first layer and use only disk swap as a second layer - or disable disk swap completely. In general, you should not have to use swap at all. Swapping is always bad with respect to performance.
  • Like
Reactions: Juertes


The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!