Segmentation is a memory-management scheme that supports the user’s view of memory, dividing a process’s logical address space into variable-sized segments—each corresponding to a logical unit such as code, data, stack, or shared libraries. Unlike paging (fixed-size blocks), segmentation preserves the program’s modular structure.


1. Segmentation Concepts

  1. Logical Address
  2. Segment Table
  3. Address Translation

2. Example

Consider a process with 4 segments:

Segment (s) Logical Unit Base (hex) Limit (bytes)
0 Main code 0x12000 30 000
1 Global data 0x1A000 5 000
2 Heap (dynamic alloc) 0x1C800 10 000
3 Stack 0x22000 4 096

This illustrates how each logical reference maps to a unique, variable-length region in physical memory.


3. Advantages of Segmentation


4. Disadvantages of Segmentation