Table of contents
1.
Introduction
2.
What is Paging in Operating Systems?
3.
Examples of Paging in Operating System
4.
Key Points About Paging in Operating Systems
5.
Memory Management Unit
6.
Terminologies Associated with Memory Control
6.1.
1. Logical Address or Virtual Address
6.2.
2. Logical Address Space or Virtual Address Space
6.3.
3. Physical Address
6.4.
4. Physical Address Space
7.
Why is paging used for memory Management?
8.
Features of Paging in PC Reminiscence Management
9.
Advantages of Paging in Operating System
10.
Disadvantages of Paging in Operating System
11.
Frequently Asked Questions
11.1.
What is the paging in the operating system memory management scheme?
11.2.
What are the two types of paging?
11.3.
What problem does paging solve?
11.4.
What does paging avoid?
12.
Conclusion
12.1.
Recommended Reading
Last Updated: Mar 30, 2025
Easy

Paging in Operating System

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Paging in an Operating System is a memory management technique that retrieves processes from secondary storage and loads them into main memory as fixed-size pages. The OS divides both processes and memory into equal-sized pages and frames, ensuring efficient memory allocation. This eliminates fragmentation and enables faster access to data by loading only the required pages into memory. Paging improves system performance and is essential for virtual memory management in modern operating systems. 

Paging in Operating System

Also Read About, Internal and External Fragmentation

What is Paging in Operating Systems?

Paging in operating systems is a memory management scheme that allows the physical memory (RAM) to be divided into fixed-size blocks called pages. It provides a way to map virtual addresses used by processes to physical addresses in memory. Here's how it works:

  1. Virtual Memory: Each process in a modern operating system uses virtual memory addresses that are independent of the actual physical memory addresses.
  2. Page Table: The operating system maintains a page table for each process, which maps virtual pages to physical pages. Each entry in the page table contains the mapping information, such as the physical address of the page in RAM.
  3. Page Size: Pages are typically of fixed size (e.g., 4 KB), making it easier to manage memory and allocate/deallocate memory blocks.
  4. Address Translation: When a process accesses a virtual address, the CPU translates this virtual address to a physical address using the page table. If the page corresponding to the virtual address is not currently in physical memory (a situation known as a page fault), the operating system swaps in the required page from secondary storage (like a hard disk) into RAM.
  5. Benefits: Paging allows efficient use of physical memory by enabling processes to use more memory than physically available. It also provides memory protection between processes and simplifies memory allocation.
  6. Page Replacement: When physical memory becomes full, the operating system uses page replacement algorithms (like LRU - Least Recently Used) to decide which pages to swap out to disk to make room for new pages.

Examples of Paging in Operating System

Dedicated registers can be used in the hardware implementation of the page table. However, using a register for the page table is only appropriate if the page table is tiny. We can employ TLB (translation Look-aside buffer), a particular, small, fast lookup hardware cache if the page table has a high number of entries.

  • The TLB is a high-speed, associative memory.
     
  • TLB entries are made up of two parts: a tag and a value.
     
  • When this memory is accessed, an item is compared to all tags at the same time.
     
  • If the object is located, the value associated with it is returned.
    Main memory access time = m
    If the page table is kept in the main memory,
    Effective access time = m(for page table) + m(for particular page in page table).
     
Examples of Paging in Operating System

For example, if the main memory is 16 KB and the frame memory is 1 KB. The main memory will be partitioned into 16 frames, each with one kB.

The system has four independent processes, 4 KB in size: A1, A2, A3, and A4.

All processes are divided into 1 KB pages for the operating system to store one page in a single frame.

All of the frames are left empty at the start of the process to ensure that all of the process pages are stored in a logical order.

Examples of Paging in Operating System

After some time, A2 and A4 are shifted to the waiting state, as seen in this example. As a result, eight frames become unoccupied, allowing new pages to be loaded into those spaces. In the ready queue is a process A5 with a size of 8 pages (8 KB).

Examples of Paging in Operating System

We can see that there are eight non-continuous frames available in the memory in this example, and paging allows us to store the process in multiple locations. This permits us to load process A5 pages instead of A2 and A4 pages.

The address generated by the CPU is divided into

  • Page number(p): Page number or the number of bits necessary to indicate the pages in Logical Address Space.
     
  • Offset(d) on the page: The number of bits necessary to represent a certain word on a page, the size of a page in Logical Address Space, or the word number of a page or the offset of a page.
     

Physical Address is divided into

  • Frame number(f): The number of bits necessary to represent a frame in Physical Address Space, often known as a frame number.
     
  • Frame offset(d): The number of bits necessary to represent a certain word in a frame, or the physical address space frame size or the word number of a frame or the frame offset. With the help of frame offset, the memory management unit can calculate the physical address of a word by combining the frame offset and the frame number. It helps to determine the location of a specific word within a frame.
     

Key Points About Paging in Operating Systems

1. Reduces internal fragmentation: Paging divides memory into a fixed size of pages. This eliminates the wasted space within each page and it improves the memory utilization.
 

2. Enables reminiscence to be allotted on call for:  When a process needs more memory, the operating system provides more pages to the process as per the need. This on-demand allocation feature makes memory utilization efficient.
 

3 Protection and sharing of memory:  Paging provides memory protection by preventing it from unauthorized access. It also shares memory between the processed by mapping multiple logical addresses to the same physical memory pages.
 

4. External fragmentation: It occurs when the free memory blocks become scattered. Paging reduces external fragmentation by allocating memory to the fixed-sized pages.
 

5. Overhead: Overhead occurs at the time of paging due to maintaining the page table and performing address translation.

Memory Management Unit

Memory Management Unit (MMU) is responsible for translating logical addresses into physical addresses in a paging system.

  • Logical Address: Generated by the CPU for each page, it consists of two parts – Page Number and Offset.

     
  • Physical Address: The actual location in memory where the corresponding page is stored.

Terminologies Associated with Memory Control

1. Logical Address or Virtual Address

The logical address is an address that is generated by the CPU in the context of a computer system’s memory management. A process or program uses this address at the time of accessing memory.

2. Logical Address Space or Virtual Address Space

The logical address space is the total range of logical addresses that a program can access. It represents the memory address and it can be larger than the physical memory.

3. Physical Address

The Physical address is a real location in the physical memory hardware where the data is stored. It is used by the hardware components to read from or write to the physical memory.

4. Physical Address Space

The Physical address space is the total range of physical addresses that are present in the physical memory. Physical address space is determined by the capacity and the architecture of the computer system.

Why is paging used for memory Management?

Paging is a crucial memory management technique that optimizes memory allocation and utilization. Here’s why it is needed:

  • Efficient Memory Utilization: Programs often require more memory than what is available in a single continuous block. Paging divides memory into smaller, fixed-size units, making it easier to allocate scattered free spaces.
  • Dynamic Memory Allocation: Since processes do not need to occupy consecutive memory locations, they can expand or contract dynamically without requiring relocation.

Features of Paging in PC Reminiscence Management

Here are some features of Paging:

  • Page desk entries:: A page table entry (PTE) is used to represent each page in a method's logical address.
     
  • Number of page desk entries: The number of entries in a method's page desk equals the number of pages inside the logical address region of the method.
     
  • Fixed web page and frame length: The page length used for paging is often the same as the size of a frame in the most crucial memory.
     
  • Logical to bodily address mapping: Paging enables a process's logical address space to be non-contiguous, which allows the process to occupy physical memory.
     
  • Page table stored in important memory: Page table is stored in the main memory that allows fast-access memory of the computer.
     

Advantages of Paging in Operating System

The following are some advantages of Paging in Operating System:-

  • Efficient memory management
     
  • Simplified allocation and deallocation
     
  • Supports virtual memory systems
     
  • Provides better utilization of physical memory

Disadvantages of Paging in Operating System

The following are some disadvantages of Paging in Operating System:-

  • Overhead due to page table maintenance
     
  • May lead to increased disk I/O
     
  • Potential for fragmentation in page allocation
     
  • Complexity in page replacement policies

 

Must Read Process Management in OS

Frequently Asked Questions

What is the paging in the operating system memory management scheme?

Paging is a memory management scheme in operating systems that divides physical memory and processes into fixed-size blocks (pages) to manage memory allocation efficiently.

What are the two types of paging?

The two types of paging in operating systems are "Hierarchical Paging," which uses a multi-level page table, and "Hashed Page Tables," which employ a hash function for page mapping.

What problem does paging solve?

Paging enables a process's logical address space to be non-contiguous, which allots the process's physical memory. We separate the processes into pages to put this strategy into practise. Blocks with defined size make up pages.

What does paging avoid?

Although paging reduces external fragmentation, internal fragmentation still exists. When memory is divided up into fixed-sized blocks, internal fragmentation occurs. It happens when a process uses less space or requires more space than the memory block size provided.

Conclusion

In this article, we learned about the important concept of memory management in operating systems. We learned about paging in operating system and Advantages and Disadvantages of Operating System. We also saw the concept of segmentation in the operating systems.

Recommended Reading

Live masterclass