Skip to main content

Swap Partition

Hello Geeks .. This article applies for most of Linux Distributions and SphinUX OS  . I tested it on ( Ubuntu , Kali , BackTrack 5 , Redhat ) but my screenshots are from SphinUX OS .

What is Swap Memory ? 

Swap memory is that drive you create while installing your OS or through your command shell to tell the operating system that when physical memory (RAM) start to get more traffic , it shall start transfer some of the data to the swap file or swap disk .( the transfer process have it's own algorithm i will not get into explaining it ) . 

How to check your Swap stats : 

There are a lot of methods to check the stats and size of swap (virtual ) memory . I will explain some of it . 
  1.To do it graphically simply from Menu , Type : Memory or Swap then click on the window to open.
  2.To do it Though shell : egrep --color 'Mem|Cache|Swap' /proc/meminfo 

Swap Memory in Linux and SphinUX OS
And as you see in my screenshot . i got Zero Swap size as i didn't create it . 

Another Method to find out Swap size and usage is simply by writing down this command :
     sudo swapon -s
Sample output would be like that : 
Filename  Type       Size       Used Priority
/dev/sda5 partition  859436  0       -1 

That's also in case you got a swap file or partition on your hard disk.

One more method is simply by this Command : cat /proc/meminfo

Output would look like that : 
meminfo for linux and SphinUX OS

How Big should my Swap File be ? 

Well .. There is no standards for it , If you're a heavy user and you got a weak physical memory ( 512MB - 1GB) so think about having 2-4 GB for swapping .. but as your physical memory increase , you will not have to waste your hard disk space on swapping .

Final Points : 

  1. Swapping is the process of exchanging memory between the Physical Memory (RAM) and The Virtual Memory (Swap Directory)  back and forth in a certain algorithm . 
  2. As the swap memory usage increase you will notice a fall down in the speed of processing as the swap memory speed depends on the speed of the hard disk which in much more slower than RAM speed recognition.
  3. If you have multi UNIX operating systems on your hard drive , you don't need to create swap for each installation . 
I hope it's useful .. 

You may also read : 

Comments

Popular posts from this blog

How To Create C# Chat Application

Hello Geeks .. Today I gonna show you How to make a Chat Application Using Microsoft C#.NET 5.0  . You Can Use Older Versions Since there is nothing special in the application that only belongs to C# 5.0 . This Application Was Created To Allow Two Computers To "Chat" Using IP Addresses Also you Can Open two Clients On The Same Computer and Use Same IP Address But Different Port.. It is simple and Easy to Use And Develop .. I also Uploaded The Full Working Project With It's Source Code On MediaFire.. You Will Find The Link At The End Of the Post :)

C# Full Pharmacy Project With Source code

Hello Geeks .. This post is one of our completely Free Projects  .. It is a Pharmacy Project that can perform a lot of operations you can also find the (.dll) files for the working Barcode Reader Machines in your country and add it to the project .

How To Create A Change Password Form in a C# Application

Hello Geeks .. This little post is a free sample C#  Windows Form that can be used to change password in a SQL Database .