Paging  Vs  Segmentation

A Quick Overview

Plus

Are you looking to improve your understanding of memory management in OS? Let’s learn about the difference between paging and segmentation, two techniques used in non-contiguous memory allocation.

Plus

What is Paging?

It involves dividing both programs, & primary memory (RAM) into fixed-sized units called pages & frames, respectively. When a program arrives to be executed, its pages are allocated to available frames in memory.

Plus

Advantages of Paging

 - Avoids external fragmentation.    - Simplifies memory allocation.    - Allows for easy process swapping.   - Helps fit memory chunks of varying sizes.

Plus

What is Segmentation?

A way of organizing a program's memory into variable-sized pieces called segments. This helps programmers think about programs in terms of its different components, like functions & global variables.

Plus

Advantages of Segmentation

 - Eliminates internal fragmentation.   - Supports programmer’s view of memory.   - Requires a smaller table to keep track of memory.

Plus

Comparison based on Address Space

 - Paging divides the address space of a process into fixed-size blocks called pages.   - Segmentation divides the address space of a process into different-sized blocks called segments.

Plus

Comparison based on Efficiency

 - Paging reduces efficiency because a single function may require access to multiple pages.    - Segmentation leads to higher efficiency since functions of the same type are kept in one segment.

Plus

Comparison based on Segmentation

 - Paging can cause internal fragmentation if program size is less than the page size determined.    - Segmentation can cause external fragmentation after removing some programs resulting in small holes.

Plus
Plus

Learn more about the differences between paging and segmentation with a detailed comparison.