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 .
That's also in case you got a swap file or partition on your hard disk.
Output would look like that :
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
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
One more method is simply by this Command : cat /proc/meminfo
Output would look like that :
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 :
- 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 .
- 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.
- If you have multi UNIX operating systems on your hard drive , you don't need to create swap for each installation .
Comments
Post a Comment
We Care About Your Opinion !