Solus Project

What is Paging in Operating System? Ultimate Guide in 2023


Introduction to Paging in Operating System

Operating systems can load programs and data from a secondary storage device into main memory using a storage structure called Paging. Frames are chunks of main memory that are consistently sized and distributed around the system using the Paging technique. For optimal utilization of system memory and to forestall external fragmentation, it is essential that frame sizes remain consistent with page sizes.

To make data accessible to the CPU, paging converts pages from the swap drive to physical memory frames. Said every frame on any page is acceptable. As a result, some problems need to be addressed by the paging system.

An Operating System Page Display

For instance, the main memory would be 8 KB if the main memory was 16 KB and the frame size was 1 KB. Here, we’ll partition the primary storage into 16 identical 1 KB images.

OS Paging with Example - javatpoint

Each of the four processes in the system, labelled A1, A2, A3, and A4, takes up 4 KB of memory. Each process is broken down into a series of 1 KB pages so that the operating system can fit one page’s worth of data into a single data frame.

All the frames start off empty, ensuring that all the process pages are saved together.

The wait condition is shown here for A2 and A4 after some time has passed. As a result, eight frames become available for use by other sites. The 8-page (8 KB) process A5 is ready and waiting.

Example of Paging in OS

Paging allows storing the process in various locations, such as the eight non-contiguous frames seen above. As a result, we can now load Process A5 pages instead of A2 and A4.

What exactly is Paging Security?

The notion of inserting an extra bit, termed the Valid/Invalid bit, has been proposed to safeguard the paging procedure. Paging Each page in a paging system is given its own protection bits. Page protection is indicated by these bits linked to each item in the page table.

There are some benefits to employing the paging approach, some of which are listed below.

  • Algorithm for managing large quantities of memory that is simple to implement
  • No Outside Fragmentation is Necessary
  • The pages and page frames may be switched out without hassle if they are of similar dimensions.
  • Paging’s Drawbacks

The disadvantages of Paging are as follows:

  • Potential for internal fragmentation.
  • Extra RAM is needed to store page tables.
  • Memory reference overhead is a potential effect of multi-level Paging.
  • The term “segmentation” is unfamiliar to most people.
  • The segmentation approach is functionally equivalent to Paging; however, unlike Paging, segments in Segmentation may vary in length.
OS Paging Example

The program’s primary function, data structures, utility functions, etc., all comprise a part of the program. Each process has its own entry in the segment map table kept by the operating system. It also lists free memory blocks, sizes, segment numbers, and physical and logical addresses in the system’s RAM or VM.

Segmentation’s Benefits

The advantages and advantages of Segmentation are listed below.

  • Give safety within the categories.
  • By referring to numerous processes in a segment, you may establish collaboration.
  • Lacking internal cohesion
  • Memory use is reduced with segment tables compared to Paging.
  • Limitations of Grouping Information by Subject
  • The disadvantages of Segmentation are as follows.

Programs are loaded into or unloaded from RAM using the segmentation technique. As a result, free memory space is fragmented into many smaller portions, which might lead to issues with external fragmentation.

Example of Paging

One of the easiest ways to accomplish Paging is to construct the page table as a collection of registers. The page table is stored in the main memory because the size of the registers is limited, while the size of the page table is often big.

This approach prevents external fragmentation and allows any free frame to be assigned to any process that requires it. However, internal disintegration is still present.

The basic premise of Paging is to break down each procedure into manageable chunks. Frames will also be used to partition the main memory.

One frame of memory will be used to hold one process page. Pages may be placed wherever in memory, but finding adjacent frames or gaps is always a top priority.

Process pages are stored in secondary storage and only loaded into main memory when needed.

Frame rates are defined differently depending on the operating system. Each frame must have the same size. In Paging, the pages are mapped to the frames, and hence the sizes of the two must be the same.

Any process that needs n pages also needs n frames, at the very least.

The first frame on the free-frame list is loaded with the first page of the process before the frame number is entered into the page table.

The frame table is a data structure that stores details on which frames are available or allocated, among other things. Each actual page frame has one item in this table.

Similar to how it maintains copies of instruction counters and register contents, the operating system also keeps a copy of the page table for each process. Additionally, anytime the operating system manually maps a logical address to a physical address, this copy converts logical addresses to physical addresses.

When a process has to be assigned to the CPU, the CPU dispatcher uses this copy to define the hardware page table.

OS Paging Example 2

The Control and Management of Memory

An MMU translates between logical and physical addresses. For each page, the CPU creates an address known as the logical address, whereas the frame’s physical address is the location where the page will be stored.

The OS must have the physical address before the CPU may access a page referenced by its logical address.

There are two components to the logical address.

Variable Offset Page Numbering System

The operating system’s memory management unit must convert the page number to the frame number.


Let’s pretend the preceding illustration represents a CPU request for the 10th word of the 4th page of procedure P3. Since process P1’s page 4 is written to frame 9, the 10th word of that frame will be returned as the actual address.


When an operating system has to load a bunch of programs into RAM, it uses a storage technique called Paging to bring the files that make up those programs from their temporary location in RAM.

The notion of inserting an extra bit, termed the Valid/Invalid bit, has been proposed to safeguard the paging procedure. Paging is a simple memory management strategy, which is its main benefit.

The segmentation approach is functionally equivalent to Paging; however, unlike Paging, segments in Segmentation may vary in length. By referring to numerous processes in a segment, you may establish collaboration. Algorithms for managing memory efficiently via Segmentation are prohibitively expensive.

Leave a Reply

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

Related Stories

Stay on op - Ge the daily news in your inbox