What is Swap Partition in Linux
On this occasion I will discuss what the meaning of the swap partition on linux and its uses, maybe for linux users the swap partition is already familiar but do you already know for sure the use of the swap partition? well then from here I will discuss it, soo just take a look.
Definition and swap function in Linux
Swap is a partition that is taken from the hard disk space which is used for virtual memory needs. When the load on RAM is excess or full, the load will be divided into virtual memory or swap partitions, so the simple thing is swap is a virtual memory that is assigned to help RAM in handling the needs of a computer / laptop.
Functions Of Swap Partitions
the function of swap itself is additional memory to run one or several applications, sometimes running an application or even multitasking will take up a lot of memory space, if that condition occurs then swap will help memory so that the application runs optimally. also during the hibernation process where the contents of the memory will be copied to the swap partition before shutting down the machine.
Ideal Size For Swap Partitions
For the ideal size of the swap partition itself, now many are debating it, some say the ideal is 2x ram but some say it can be adjusted according to their own needs. In my opinion, the size of the swap partition can adjust to your own needs because if you use the 2x RAM benchmark for today's laptops / computers it will waste a lot of hard disk space, just imagine if I have a computer with 16 GB of RAM, yes. using 32GB just for a swap partition? unless your laptop / computer RAM is still below 2GB it is still possible if you use 2x RAM. If you are still in doubt, just try it in a virtual machine and you can compare it yourself if you use 2x ram and only need it, surely it won't have too much effect if the ram is big.
Kinds of Swap Partitions
Swap can be in the form of a partition or a file, if you use swap in the form of a partition then you have the advantage if you install more than 1 linux variant you don't have to bother making many swap partitions so you only need 1 swap partition for 2 or even more linux variants.
Swap in the form of this file is made into the system partition, the advantage is that the swap capacity is flexible or can be changed at any time, so this swap type will be very suitable for those of you who want flexibility in using swap, but if you use this type so if you use more than 1 linux variant then in each linux variant there must be a swap file.