Ubuntu – If I want 8GB swap, am I supposed to select 8000MB or 8192MB when selecting size


When selecting the partition to use manually, you can enter the size of the partition. So my question is, if I want 8GB swap size for my 8GB ram (yes I know the FAQs about the size of the swap etc) , am I supposed to select 8000MB as in 1GB = 1000MB or 8192 as in 1GB = 1024MB?

Best Answer

TL;DR: It does not really matter.

RAM is universally measured in powers of 2. This is often written as GiB, so 8GiB is 8*1024=8192MiB RAM.

If you look at physical RAM chips they'll always come in powers of two, e.g. 1024MiB, 2048, 16384MiB etc.

Hard drives are typically measured in powers of ten, using SI prefixes, for instance, 80GB = 80*1000MB.

So 8GiB of RAM is 8192MiB of RAM. For swap, you typically want a swap space that is big enough to hold all of RAM for suspension, so 8192MiB would be the safe option. Note that it really doesn't matter, as Linux will almost never use 100% of RAM anyway; a lot will be used for caching and so on, which will not be saved when you hibernate.