Operating System Memory Management: Paging, Segmentation, Address Spaces & Fragmentation




Distinguish, differentiate, compare and explain what is the difference between Paging and Segmentation, Logical vs. Physical Address Spaces, and Internal vs. External Fragmentation. Operating Systems Guide.

Paging vs. Segmentation

Feature Paging Segmentation
Block Size Fixed-size blocks (physical memory divided into frames; logical into pages). Variable-size blocks based on logical programming units (functions, arrays, stacks).
Programmer Visibility Completely invisible to the programmer; managed strictly by the OS and hardware MMU. Visible to the programmer; compiler breaks program into logical segments.
Hardware Translation Uses a Page Table (Page number + Offset). Uses a Segment Table (Segment base address + Segment limit/length).
Fragmentation Type Suffers from Internal Fragmentation (unused space in final page); zero external fragmentation. Suffers from External Fragmentation (scattered free memory blocks); zero internal fragmentation.

Internal Fragmentation vs. External Fragmentation

Parameter Internal Fragmentation External Fragmentation
Location of Wasted Space Occurs inside allocated memory blocks or pages. Occurs outside allocated partitions (in free space between processes).
Cause Process is assigned a fixed-size partition larger than requested data size. Dynamic memory allocation and deallocation leaves tiny non-contiguous holes.
Remedy / Solution Reduce page size or implement dynamic slab allocation. Memory Compaction, or implementing Paging / Virtual Memory.

Logical Address Space vs. Physical Address Space

Feature Logical (Virtual) Address Space Physical Address Space
Generation Source Generated directly by the CPU during program execution. Represents the actual hardwired electrical address lines on the physical RAM bus.
Translation Mapped by the Memory Management Unit (MMU) using base registers or page tables. Direct access to RAM capacitor storage locations.


Tags: