Site icon DataFlair

Paging vs Segmentation in Operating System

OS Paging Vs segmentation

We offer you a brighter future with FREE online courses - Start Now!!

Paging and segmentation are both storage mechanisms that help store processes. There is a very slight difference between these mechanisms.See paging vs segmentation in OS.

Paging in Operating System

Paging is a logical concept that allows the OS to retrieve processes into the main memory from the secondary storage. It provides faster access to data as processes are stored in the form of pages.

The main system memory is divided into frames i.e., small fixed-size blocks of physical memory where the size of frames is equal to the size of pages. This provides maximum utilization of the main system memory and helps avoid external fragmentation.

Advantages of Paging in OS

Following are the advantages of Paging:

Disadvantages of Paging in OS

Following are the disadvantages of paging:

Segmentation in Operating System

Segmentation is similar to paging, except that the length of segments is variable and pages have a fixed size. The segment of a program comprises the program’s main function, data structures, utility functions, etc.

All this information about processes is maintained in the form of a segment map table by the OS. This table includes a list of segment numbers, free memory blocks, their sizes, and their memory locations in the main memory or virtual memory.

Advantages of segmentation in OS

Technology is evolving rapidly!
Stay updated with DataFlair on WhatsApp!!

Following are the advantages of segmentation:

Disadvantages of Segmentation in OS

Following are the disadvantages of segmentation:

Paging vs Segmentation in OS

Paging Segmentation
Fix sized pages Variable sized segments
Internal fragmentation No internal fragmentation
Hardware decides the page size The user decides the segment size
Faster memory access Memory access is slower as compared to paging
Page table stores data Segmentation table stores data
Sharing of procedures is not allowed Sharing of procedures is allowed
Cannot distinguish and secure procedures and data Can separate and secure procedures and data
1-D address space Multiple independent address spaces
A single integer address is divided into page number and offset by the hardware The user divides address in segment number and offset

Summary

Paging and segmentation are both storage mechanisms that help store processes. Paging is a logical concept that allows the OS to retrieve processes into the main memory from the secondary storage. Segmentation is similar to paging, except that the length of segments is variable and pages have a fixed size.

Exit mobile version