BCA / B.Tech 13 min read

Paging in Operating System

Paging in Operating System:


Paging is an important memory management technique used in operating systems to divide main memory (RAM) into small, fixed-size portions. Its main purpose is to solve the problem of fragmentation and make memory allocation more efficient. Paging is also used in virtual memory systems, where large processes are divided into smaller pages that are loaded into physical pages (frames) in main memory.

What is Paging?

Paging is a memory management scheme in which the logical memory of a process is divided into small, fixed-size blocks called Pages. Similarly, the main memory is divided into blocks of the same size, called Frames. The main idea of paging is that any page can be loaded into any frame, which reduces internal fragmentation.

Key Concepts of Paging:

1. Pages: These are small parts of the logical memory. The entire memory of a process is divided into pages. Each page is of a uniform size, typically 4KB or 8KB.
2. Frames: These are small blocks of main memory, of the same size as pages. Frames are where the pages are loaded.
3. Page Table: A data structure used to translate logical addresses to physical addresses. It stores the mapping of a page to a frame number.

Types of Paging:

1. Single-Level Paging: Uses a single page table for direct mapping. Suitable for small systems.
2. Multi-Level Paging: If the page table becomes too large, it is also divided into pages. The translation is done in multiple levels.
3. Inverted Paging: Page table entries are created according to the frames in main memory, not the pages of a process. Used for systems with very large main memory.
4. Demand Paging: Only the required pages of a process are loaded into memory. If a needed page is not in memory, a page fault occurs, and it is loaded from the disk.
5. Virtual Paging: A technique where the process is made to feel as if its entire memory is in main memory, while actually only the necessary pages are loaded.

Advantages of Paging:

  • Eliminates External Fragmentation: Since pages and frames are of a uniform size, there is no external fragmentation.
  • Efficient Memory Usage: Only necessary pages are loaded into main memory.
  • Supports Virtual Memory: Allows large processes to run in limited main memory.
  • Flexible Memory Allocation: Pages of a process can be stored anywhere in main memory.

Disadvantages of Paging:

  • Page Table Overhead: Maintaining page tables requires extra memory.
  • Page Faults: Loading pages from the disk upon a page fault takes time and slows down the process.
  • Translation Delay: Translating logical addresses to physical addresses using the page table takes some time.
  • Internal Fragmentation: Although external fragmentation is eliminated, internal fragmentation can still occur because the last page of a process might not be full.

In this Chapter

Paging in Operating System
Distributed System in Operating System
Real-Time System in Operating System
System Calls in Operating System
System Programs in Operating System
Structure of an Operating System
Layered Design of an Operating System Structure
UNIX in Operating System
Virtual Machine in Operating System
Kernel-Based Operating System
Process Concept in Operating System
Interacting Processes in Operating System
Threads in Operating System
Fundamentals of Scheduling in Operating System
Scheduling Criteria in Operating System
Long, Medium, and Short-Term Scheduling
Scheduling Algorithms in Operating System
Structure of a Concurrent System
Critical Region in Operating System
Critical Section in Operating System
Inter-process Communication (IPC) in Operating System
Monitors in Operating System
Semaphores in Operating System
Semaphore Implementation & Uses in Operating System
Logical and Physical Address in Operating System
Swapping in Operating System
Contiguous Allocation in Operating System
Segmentation in Operating System
Virtual Memory using Segmentation in Operating System
Interprocess Communication Protocol in Operating System
Network Operating System
Design Issues in Distributed File System
Network Structure in Operating System
Structure of a Distributed System
File System and Coordination in Operating System
History of Linux in Operating System
Linux Commands
Programmer Interface & File Manipulation in Linux
Process Control in Linux
Kernel & Signals in Linux
File System in Linux
Blocks and Inodes in Linux
System Editors in Linux
Character Transliteration in Linux
The `ed` Line Editor in Linux
The `vi` Editor and Its Commands
Shell Scripting in Linux
Looping & Decision Making in Linux Shell Scripting
Variables & File Name Expansion in Linux
Arrays in Linux Shell Scripting
Subprograms (Functions) in Linux Shell Scripting
C Interface with Linux
Simple Shell Programs in Linux
BCA Part-1 | Operating Systems | Semester-I | MDSU Exam Paper 2023 (Held in 2024)
What is an Operating System (OS)
Operating System (OS) All Important Questions and Answers in English (MDSU)
BCA || Operating System 2025 Paper || MDSU Exam Paper
BCA | OS(Operating System) 2023 Paper | MDSU Exam Paper
Types of Operating Systems
Goals of an Operating System
Operations of an Operating System
Resource Allocation & Functions in an Operating System
Classes of Operating System
Batch Processing in Operating System
Multiprocessing in Operating System
Time-Sharing in Operating System