While installing many of we ignore Swap space. It does not matter what Linux Distro you are using. It can be the last Mint or Ubuntu or any older Debian based operating system. Swap space place a vital role in your systems performance. You cannot just ignore that. I had tested two systems. Both are working on latest Linux Mint Maya. The only different among them was the Swap space. System A has a dedicated partition of 20GB as swap space and System B does not have any swap space. There are major changes in performance observed. When I open YouTube using Opera in System a, it worked smoothly. I had downloaded some software on the same hand, played music files, etc. In system monitor the ram usage was clear and it showed that with Swap space Linux manages the performance. But in System B, when same process was repeated it started freezing at some point. Though there was 50% physical memory available. It looks that some part of ram is kept reserved. The explorer takes time to open and files were listed slowly. The same if done in Windows, then this is a disaster. Swap space is same as Page File in Windows.
In simple word a Page file is memory management tool which is used by resource intensive application to perform well. Many time in Task Manage you can see the virtual memory usage. Swap space is similar to that. Your hard drive has ample of free space. You can assign an empty partition as Swap space and continue with your work. Linux do not format that partition but uses its empty space to fulfill the memory requirement. This is very important for every system. Swap space can improve the systems output. Do not ignore the same while installation. To understand how Swap space work, lets learn about Page file. Here is a very common example. Let’s assume that you have two desks in front of you. The first desk is filled with objects like pager, computer, printer, etc. The second desk is partially filled. Now to arrange a set of paper you need some empty space. For temporary basis you can use the second desk. You can move the papers on it and then pickup them back on your desk. Page File is somewhat similar to that.
In a computer you have two types of memories. First is Physical memory, what you called RAM and the second is Virtual memory which is actually your empty hard drive storage space. Operating system needs physical memory (RAM) to initiate various functions. But when the limit is crossed, then they work on special algorithm (supported by hardware) which helps them to use the empty hard drive space as ram. For example when you open a web browser, it needs RAM to keep those all stuff on your screen, the buttons, the window, etc. But when you open more than 1 tab more memory is consumed. In order to maintain the performance virtual ram is used.
The data is divided into small parts inside memory. Those small parts are known as pages. When the physical memory is out of stock, those pages are transferred to your empty partition for some time. Swapping consist of process where those parts are actually moved to a hard drive partition which is configured as Swap space. Combination of physical and swap space makes the virtual memory. The more you have the better system works. Today’s applications are designed features point of view because of which they need more memory power. The same is mostly applicable to web browser. You can find simply how much ram they consume when you check in System Monitor. The last test that I did, when I open around 7 videos in different opera tab. The maximum ram it was eating was 292 mb. Now you can considered what would your operating system if a major part of resource is consumed so instantly. It will freeze or lag.
But the best part of Linux Distros is that they do not simple go black. In Windows if this thing happen, the screen just zombify. Nothing happens, no mouse movement, app stucked in between, no keyboard reaction, etc. But in Linux after little time, things went back to normal. Swap is needed in every system. It makes your process smoother. Swap helps the system by providing more memory to those applications which are resource intensive. Because of which you do not find any difference on your screen, but in the background this all process are carried out. In some case swap fails. There is a reason for that. Linux mostly work on two different type of swap space. Among which one is dedicated to swap partition assigned by you and second is the swap file which works inside the file system.
Bookmarks