Compare the Difference Between Similar Terms

Difference Between

Home / Technology / IT / Operating System / Difference Between Paging and Swapping

Difference Between Paging and Swapping

July 3, 2011 Posted by Indika

Paging vs Swapping

Paging is a memory management method used by operating systems. Paging allows the main memory to use data that is residing on a secondary storage device. These data are stored in the secondary storage device as blocks of equal size called pages. Paging allows the operating system to use data that will not fit in to the main memory. Swapping is a term that is used to describe the act of moving all the segments belonging to a process between the main memory and a secondary storage device.

What is Paging?

Paging is a memory management method used by operating systems. Paging allows the main memory to use data that is residing on a secondary storage device. These data are stored in the secondary storage device as blocks of same size called pages. Paging allows the operating system to use data that will not fit in to the main memory. When a program tries to access a page, first the page table is checked to see whether that page is on the main memory. Page table holds details about where the pages are stored. If it is not in the main memory, it is called a page fault. Operating system is responsible for handling page faults without showing it to the program. The operating system first finds where that particular page is stored in the secondary storage and then brings it in to an empty page frame in the main memory. Then it updates the page table to indicate that the new data is in the main memory and returns the control back to the program that initially requested the page.

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. Swapping occurs under heavier work loads. Operating system 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 in to the main memory from the swap space so that its execution could be continued.

What is the difference between Paging and Swapping?

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. Since paging allows moving pages (it could be a part of the address space of a process), it is more flexible than swapping. Since, paging only moves pages (unlike swapping, which move a whole process), paging would allow more processes to reside on the main memory at the same time, when compared with a swapping system. Swapping is more suitable when running heavier workloads.

Related posts:

Difference Between Paging and Segmentation Difference Between 32 bit and 64 bit Windows 7 Difference Between Ubuntu and Debian Difference Between Leopard and Snow Leopard Difference Between Yum and RPM

Filed Under: Operating System Tagged With: memory management, operating systems, page, page fault, Page table, pages, Paging, swap, swap area

About the Author: Indika

Indika, BSc.Eng, MSECE Computer Engineering, PhD. Computer Science, is an Assistant Professor and has research interests in the areas of Bioinformatics, Computational Biology, and Biomedical Natural Language Processing.

Comments

  1. Joel says

    April 25, 2017 at 5:38 am

    the mooost clear explanation,greatjob 🙂

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Request Article

Featured Posts

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and SARS

Difference Between Coronavirus and SARS

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Covid 19

Difference Between Coronavirus and Covid 19

You May Like

Difference Between Hungry Jack’s and Burger King

Difference Between Osteoarthritis and Rheumatiod Arthritis

Difference Between Osteoarthritis and Rheumatiod Arthritis

Difference Between Carbon Dots and Quantum Dots

Difference Between Carbon Dots and Quantum Dots

Difference Between Synchondrosis and Symphysis

Difference Between Synchondrosis and Symphysis

Difference Between Censorship and Restrictions

Latest Posts

  • What is the Difference Between Typhoid and Viral Fever
  • What is the Difference Between Interstitial Lung Disease and Pulmonary Fibrosis
  • What is the Difference Between Liquid and Powder Foundation
  • What is the Difference Between Apert and Crouzon Syndrome
  • What is the Difference Between Cordyceps Militaris and Cordyceps Sinensis
  • What is the Difference Between Penta and Hexa Vaccine
  • Home
  • Vacancies
  • About
  • Request Article
  • Contact Us

Copyright © 2010-2018 Difference Between. All rights reserved. Terms of Use and Privacy Policy: Legal.