1751967 Members
4700 Online
108783 Solutions
New Discussion юеВ

Re: Swapping and Paging

 
Indrajit Bhagat
Regular Advisor

Swapping and Paging

HI ALL,
I wan to know that what is the difference between the swapping and paging
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor

Re: Swapping and Paging

Hi:

The terms are used somewhat loosely to mean the same thing. Strictly speaking they are different.

"Swapping" is an old mechanism where whole process images were moved from memory to disk to free memory for another process.

"Paging" is the deactivation of pages or portions of a process's memory. That is, the least most recently used pages are moved to disk as necessary to create free memory.

HP-UX uses paging, although the disk allocated to hold the deactivated memory pages is called "swap".

Regards!

...JRF...
melvyn burnard
Honored Contributor

Re: Swapping and Paging

posted in wrong forum, moved to more appropriate forum
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Venkatesan_5
Frequent Advisor

Re: Swapping and Paging

Hi Indrajit,

Here is your answer..

In particular, "swapping out a process"
used to be simultaneously a scheduling operating and a memory management
operation.

With paging, there is no explicit connection between how much of a program's
virtual memory is resident and whether that process is schedulable. A
program in a tight loop might only have one or two pages mapped with the
majority of it being paged out. In other words, the OS just grabs pages away
from processes, and doesn't give them back unless the process asks for them
again (via a page fault).


With swapping, the OS guarantees that the program is resident before
scheduling it. The program may also explicitly manage swapping in areas of
memory, by asking the OS to swap the data in before the program uses it, and
telling the OS it's done afterwards. (Windows allows memory to be managed
this way.)


Paging is preferred over swapping because it does a better job of keeping
only the most important data in memory. However, paging requires restartable
instructions, so that an instruction can be restarted after a page fault has
been handled. You also need an MMU or a TLB to handle the
virtual-to-physical address conversions.

regards

Venkat.
sudhapage
Regular Advisor

Re: Swapping and Paging

Hi.

Swapping occurs when whole process is transfered to disk, while paging is when some part of process is transferred to disk while rest is still in physical memory.

Regards
Sudhakaran.K
Jaime Bolanos Rojas.
Honored Contributor

Re: Swapping and Paging

Indrajit,

Also, if you are having issues with memory or want to know more about it this is an excellent document to read,

ftp://eh:spear9@hprc.external.hp.com/memory.htm

Regards,

Jaime.
Work hard when the need comes out.
Yogeeraj_1
Honored Contributor

Re: Swapping and Paging

Hi indrajit,

Swapping is one of the Unix mechanisms to accommodate the size limitation of memory by moving entire processes to disk to reclaim memory.

Paging is another Unix machanism to manage the limitations of memory. Unlike swapping, where entire processes are moved in and out of memory, paging moves only individual pages of processes to disk. Paging is not as serious a problem as swapping, as the entire program does not have to reside in memory to run. A small amount of paging may not noticeably affect the performance of a system. However, the performance of a system may degraderapidly as paging activity increases.

Swap space on disk is used to hold pages of memory that have been paged or swapped out. A shortage of swap space may cause symptoms such as system hanging, poor response times, and unsuccessful spawning of new processes.

Hope this helps!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)