What is Paging in Operating System?

By Priyanshu Vaish|Updated : September 30th, 2022

Paging in OS is the static memory allocation technique in the operating system in which the physical address space of a process is to be non-contiguous. When a new process arrives, its size(in pages) is determined. If the process has n pages in logical memory, then n frames must be available in the physical or main memory. 

If we want to support paging in the operating system, then the operating system (OS) determines the number of pages in the program and locates enough empty page frames in the memory to facilitate it. The operating system maintains the job table, page table, and frame table to support paging in OS (operating system). Here, this article will discuss paging in OS, its address translation, characteristics, and important points.

Download Formulas for GATE Computer Science Engineering - Operating Systems

Table of Content

What is Paging in OS?

Paging in OS is a dynamic and flexible technique that can load the processes in the memory partitions more optimally. The basic idea behind paging is to divide the process into pages so we can store these pages in the memory at different holes(partitions) and use these holes efficiently.

Define Paging in OS

The paging in OS is used to support non-contiguous memory allocation. Secondary memory will be divided into fixed-sized partitions of equal size, and each of these is called a page. Similarly, the main memory is divided into equal fixed-size partitions; each called a frame.

Download Formulas for GATE Computer Science Engineering - Databases

Address Translation in Paging in OS

The address translation in paging in OS is an address space that is the range of valid addresses available in a program or process memory. It is the memory space accessible to a program or process. The memory can be physical or virtual and is used for storing data and executing instructions. The two main types of address space are described below:

  • Logical address space
  • Physical address space

Paging in OS Diagram

The below diagram explains the technique of mapping a logical address to a physical address in paging in OS(operating system): byjusexamprep

In the above diagram of the translation of logical to a physical address in paging in the operating system as the CPU generates a logical address containing the page number and offset. Then, corresponding to the page number, we check the frame number in which it is stored from the page table. The frame number is then added with the offset value to get the physical address, and then the memory is accessed with it.

Download Formulas for GATE Computer Science Engineering - Computer Networks

Characteristics of Paging in OS

The characteristics of the paging in OS(operating system) is that there is no external fragmentation by assuming the size of the main memory is in powers of 2. Processes can use all frames in the physical or main memory.

Paging in OS(operating system), the internal fragmentation may occur only on the last page of a process. The physical memory used by a process is no longer contiguous (non-contiguous). The logical memory of a process is still contiguous.

Important Points for Paging in Operating System (OS)

The hardware defines the page size in paging in OS. All the frames and pages in the memory are of the same size. Some of the important points for the paging in OS(operating system) are as follows:

  • Whenever the process is created, paging in OS will be applied to the process, and a page table will be created. The base address of the page table will be stored in the PCB.
  • Paging in OS is for every process, and every process will have its own page table.
  • Page Table of the processes will be stored in the main memory.
  • There is no external fragmentation in the paging in OS because the page size is the same as the frame size.
  • The internal fragmentation exists on the last page, and internal fragmentation in the paging in OS is considered, where P is the page size.
  • Maintaining the page table is considered an overhead (burden) for the system.

Important GATE Topics

FDD Full FormResistors In Parallel
ISP Full FormResistors In Series
Stress And StrainProperties Of Gases
IEEE Full FormEnvironmental Studies Mcqs
Two Port NetworkFixed Beams

Comments

write a comment

FAQs on Paging in OS

  • The paging in OS(operating system) is the solution to the external fragmentation problem, which allows the logical address space of the process to be non-contiguous. Thus, allowing a process to be allocating physical memory wherever the process is available.

  • The basic method that can be used for paging in OS(operating system) involves breaking physical or main memory into fixed-sized partitions or blocks called frames and breaking logical memory into blocks of the same size as frames are called pages. Its pages are loaded into the available memory frames when the process is executed.

  • The paging in OS(Operating system) allows the physical address space of the process to be non-contiguous. Paging in OS(operating system) reduces external fragmentation but still suffers from internal fragmentation.

  • The advantage of paging in OS(operating system) is that paging reduces external fragmentation but still suffers from internal fragmentation. The paging is implemented easily and assumes that paging in OS(operating system) is an efficient technique for memory management.

  • The disadvantage of paging in OS(operating system) is that the paging in OS(operating system) suffers from internal fragmentation, and it requires additional memory space to store the page table in the memory, which is a loss of memory.

Follow us for latest updates