Difference between Paging and Segmentation

Paging and Segmentation are two memory management techniques used by operating systems to efficiently allocate memory to processes. Paging divides memory into fixed-size blocks, while segmentation divides it into variable-size logical units.

Paging

Paging is a memory management technique in which a process address space is broken into fixed-size blocks called pages (typically a power of 2, between 512 bytes and 8192 bytes). Main memory is similarly divided into fixed-size blocks called frames, with frame size equal to page size. This ensures optimum utilization of main memory and avoids external fragmentation.

Segmentation

Segmentation is a memory management technique in which each process is divided into several segments of different sizes, one for each logical module (main function, utility functions, data structures, etc.). Each segment represents a different logical address space. Segments are loaded into non-contiguous memory, but each individual segment occupies a contiguous block. The OS maintains a segment map table storing the starting address and length of each segment.

Paging (Fixed Size) Page 0 (4KB) Page 1 (4KB) Page 2 (4KB) Page 3 (4KB) Frame 5 Frame 2 Frame 8 Frame 1 All blocks same size Segmentation (Variable Size) Code (2KB) Data (6KB) Stack (1KB) Heap (4KB) Segment Table Base | Limit 1000 | 2KB 3000 | 6KB 5000 | 1KB 7000 | 4KB Blocks vary in size

Key Differences

Feature Paging Segmentation
Block Size Fixed-size pages Variable-size segments
Managed By Operating system Compiler (calculates segment sizes and addresses)
Size Determined By Available memory (hardware) Logical structure of the program (user/compiler)
Speed Faster memory access Slower than paging
Fragmentation Internal fragmentation (underutilized pages) External fragmentation (unused memory gaps)
Logical Address Page number + page offset Segment number + segment offset
Lookup Table Page table (page → frame mapping) Segment table (base address + length)

Conclusion

Paging divides memory into equal fixed-size blocks for simple and fast allocation but may cause internal fragmentation. Segmentation divides memory into variable-size logical units matching program structure but may cause external fragmentation. Many modern operating systems combine both techniques (segmented paging) to get the benefits of each.

Updated on: 2026-03-14T10:21:41+05:30

39K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements