top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the difference between Swapping and Paging?

+2 votes
224 views
What is the difference between Swapping and Paging?
posted Jul 27, 2015 by Mohammed Hussain

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote
 
Best answer

In paging, blocks of equal size (called pages) are transferred between the main memory and a secondary storage device, while in swapping, all the segments belonging to a process will be moved back and forth between the main memory and a secondary storage device.

What is Swapping?
Swapping is the process of moving all the segments belonging to a process between the main memory and a secondary storage device. Kernel would move all the memory segments belonging to a process in to an area called swap area. When selecting a process for swapping, the operating system will select a process that will not become active for a while. When the main memory has enough space to hold the process, it will be transferred back.

What is Paging?
In Paging whole process is divided into equal size pages and stored in the virtual memory (storage). The operating system copies a certain number of pages from your storage device to main memory. When a program needs a page that is not in main memory, the operating system copies the required page into memory and copies another page back to the disk. By this method OS is able to execute the process which is larger then the memory itself or the list of processes simultaneously larger then the memory.

answer Jul 28, 2015 by Salil Agrawal
+1 vote

Swapping:

Whole process is moved from the swap device to the main memory for execution. Process size must be less than or equal to the available main memory. It is easier to implementation and overhead to the system. Swapping systems does not handle the memory more flexibly as compared to the paging systems.

Paging:

Only the required memory pages are moved to main memory from the swap device for execution. Process size does not matter. Gives the concept of the virtual memory. It provides greater flexibility in mapping the virtual address space into the physical memory of the machine. Allows more number of processes to fit in the main memory simultaneously. Allows the greater process size than the available physical memory. Demand paging systems handle the memory more flexibly.

answer Jul 28, 2015 by Manikandan J
...