3

I want to know why the swap partition have to more double size the RAM Size ? for example if the ram installed in machine 64 G.B , the swap have to be 128 G.B ?

5

It doesn't, it was a rule from the old days when RAM was prety limited and swapping was necessary for many operations (usually the main reason given was a copy-everything implementation of fork()). Nowdays it is really not important to have swap working, if RAM is enough you can even have no swap at all - it depends on what your preferred solution to memory pressure is: either slow swapping or fast OOM killing.

It is even recomended not to have swap on mediums like flash cards. Still that much swap is usable in one place, laptops. When they do hibernate, they save entire content in RAM to swap disk. So swap in laptops to enable hibernation needs to be at least as big as RAM (unless the hibernation image is compressed, or one is hibernating into a regular file on a file system).

You might also want to read Is swap an anachronism? and Why use swap when there is more than enough free space in RAM?.

2

If you are using Redhat Enterprise Linux (or Redhat Base linux), the recommendations are

enter image description here

Source : https://access.redhat.com/site/solutions/21287

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.