Need of swap space in Linux?

Posted: December 7, 2011 in Linux
Tags: , , ,

whenever i install linux, i ll allocate twice the amount of RAM for swap space without knowing its need. Now i found why we are allocating the swap space and how much its related with system speed..First i need to assert a statement that “there is no need of allocating twice the amount of RAM as swap space in linux”. For older systems they have followed that rule..

Linux divides its physical RAM (random access memory) into chucks of memory called pages. Swapping is the process whereby a page of memory is copied to the preconfigured space on the hard disk, called swap space, to free up that page of memory. The combined sizes of the physical memory and the swap space is the amount of virtual memory available.

Swapping is necessary for two important reasons. First, when the system requires more memory than is physically available, the kernel swaps out less used pages and gives memory to the current application (process) that needs the memory immediately. Second, a significant number of the pages used by an application during its startup phase may only be used for initialization and then never used again. The system can swap out those pages and free the memory for other applications or even for the disk cache.

to check your swap space type

swapon -s in terminal.. it will show the type and size of the swap.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s