ArcoLinux -D -B 19.5 iso's have been released

[INFO] How much swap you need?

Must read
Post Reply
User avatar
erikdubois
Captain
Posts: 2115
Joined: Tue Nov 07, 2017 3:45 pm
Location: Belgium
Contact:
Belgium
[INFO] How much swap you need?

Post by erikdubois » Sat Dec 29, 2018 8:08 pm

A question about swap size gives me an opportunity to share this post - you decide how much you want/need

https://itsfoss.com/swap-size/

We hope the article stays online.

Here is a short excerpt.

Why is swap needed?


There are several reasons why you would need swap.

If your system has RAM less than 1 GB, you must use swap as most applications would exhaust the RAM soon.
If your system uses resource heavy applications like video editors, it would be a good idea to use some swap space as your RAM may be exhausted here.
If you use hibernation, then you must add swap because the content of the RAM will be written to the swap partition. This also means that the swap size should be at least the size of RAM.
Avoid strange events like a program going nuts and eating RAM.

How much swap do I need?


If you go by Red Hat’s suggestion, they recommend a swap size of 20% of RAM for modern systems (i.e. 4GB or higher RAM).

CentOS has a different recommendation for the swap partition size. It suggests swap size to be:

Twice the size of RAM if RAM is less than 2 GB
Size of RAM + 2 GB if RAM size is more than 2 GB i.e. 5GB of swap for 3GB of RAM

Ubuntu has an entirely different perspective on the swap size as it takes hibernation into consideration. If you need hibernation, a swap of the size of RAM becomes necessary for Ubuntu.

Otherwise, it recommends:

If RAM is less than 1 GB, swap size should be at least the size of RAM and at most double the size of RAM
If RAM is more than 1 GB, swap size should be at least equal to the square root of the RAM size and at most double the size of RAM
If hibernation is used, swap size should be equal to size of RAM plus the square root of the RAM size
Learn, have fun and enjoy.
But first use the power of the Arch Wiki
use the tutorials on https://www.youtube.com/erikdubois
then use the power of google
then use the power of our moderators.


Post Reply

Return to “Frequent Asked Questions”