Operating System

Paging and Segmentation


Paging and Segmentation are two important memory management techniques used by Operating Systems to efficiently allocate memory and support smooth execution of multiple processes.

Both techniques solve memory management problems in different ways: Paging focuses on fixed-size blocks, while Segmentation focuses on logical program structure.


Paging

Paging divides memory into fixed-size blocks called frames, and processes into fixed-size blocks called pages.

  • Pages are mapped to frames using a page table
  • Eliminates external fragmentation
  • Allows non-contiguous memory allocation
  • Improves memory utilization

Paging Structure

Process Pages
Page 0
Page 1
Page 2
Page 3
Memory Frames
Frame 3
Frame 1
Frame 7
Frame 9

Segmentation

Segmentation divides a program into logical units such as functions, stacks, heap, data, and code segments.

  • Each segment has a different size
  • Based on logical view of the program
  • Easy to protect and share segments
  • More natural for programmer understanding

Segmentation Structure

Code Segment
Data Segment
Stack Segment
Heap Segment

Paging vs Segmentation

PagingSegmentation
Fixed-size blocksVariable-size segments
No external fragmentationMay suffer external fragmentation
Hardware-based mappingLogical/program-based view
Simple but less flexibleMore flexible and meaningful

Key Points

  • Paging uses fixed-size memory blocks called pages and frames.
  • Segmentation uses logical divisions of a program.
  • Paging removes external fragmentation.
  • Segmentation improves logical structure and protection.
  • Modern systems often combine both techniques.

Summary

Paging and Segmentation are fundamental memory management techniques. Paging focuses on efficient memory utilization using fixed-size blocks, while segmentation focuses on logical organization of programs. Together, they help operating systems achieve efficient, flexible, and scalable memory management.

Ready to test your Chapter VII: Paging and Segmentation knowledge?

Chapter VII: Paging and Segmentation

Deep-dive quiz on paging structure, segmentation types, address translation, and how both techniques compare and combine.

5 questions·No time limit·Instant feedback