- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference Between Paging and Swapping in OS
Both paging and swapping are important concepts in operating systems that place a process in the main memory for its execution, but they are quite different from each other in many aspects. Read this article to learn more about paging and swapping and their specific characteristics.
What is Paging?
In OS, Paging is a memory management strategy in which the process address space is divided into blocks of the same size, called pages (where the size of each page is power of 2, and is between 512 bytes and 8192 bytes). The size of the process is then measured in the number of pages.
In the same way, the main memory is divided into small blocks of fixed size called frames. The size of each frame is kept the same as that of a page to have the optimum utilization of the main memory and to avoid the external fragmentation. Therefore, paging is basically a memory allocation technique. It utilizes non-contiguous memory management technique.
What is Swapping?
Swapping is a memory management technique in which an entire process is copied to another location. In other words, swapping is a technique in which an entire process is to be placed in the main memory for its execution. Also, swapping removes the inactive processes from the main memory of the system.
Swapping helps to provide memory space for the operation of other processes. Hence, swapping impacts the performance of a system, as it helps in executing multiple large operations concurrently. Swapping can be done without using any memory management technique.
Now, let us discuss the differences between paging and swapping in detail.
Difference between Paging and Swapping in OS
The following are the important differences between paging and swapping in Os −
S.No. |
Swapping |
Paging |
---|---|---|
1. |
It is process where the entire process is copied to another location. |
It is a memory allocation technique. |
2. |
This process occurs when the entire process has been transferred to the disk. |
This process occurs when a part of a process is transferred to the disk. |
3. |
Here, the data is swapped temporarily from the main memory to a secondary memory. |
The contiguous block of memory is made non-contiguous but it consists of fixed size called frames known as pages. |
4. |
It can be done without using any memory management methods. |
It uses non-contiguous memory management technique. |
5. |
It can be done by processes that are inactive as well. |
Only a process that is currently active can perform paging operation. |
6. |
It helps give a direction with respect to the solution. |
There is no suggestion about the solution in this technique. |
Conclusion
The most significant difference between the two is that swapping is a process where the entire process is copied to another location, while paging is a memory allocation technique.
- Related Articles
- Difference Between Paging and Segmentation in OS
- Difference between Paging and Segmentation
- Difference between Demand Paging and Segmentation
- Difference between Network OS and Distributed OS
- Difference Between Deadlock and Starvation in OS
- Difference Between Semaphore and Monitor in OS
- Difference Between Multitasking and Multithreading in OS
- Difference Between Buffering and Caching in OS
- Difference Between Interrupt and Polling in OS
- Difference Between Spooling and Buffering in OS
- Difference Between Virtual and Cache Memory in OS
- Difference Between Preemptive and Non-Preemptive Scheduling in OS
- Difference Between Long-Term and Short-Term Scheduler in OS
- Differentiate between OS and DBMS files and OS and DBMS buffer manager
- What are the differences between Client OS and Server OS?
