Segmentation in Operating System (original) (raw)

Last Updated : 21 Apr, 2026

Segmentation is a memory management technique in which a process is divided into variable-sized units called segments, where each segment represents a logical part of a program such as functions, arrays, or modules. It follows the user’s logical view of memory and allows flexible organization, protection, and sharing of data.

logical_view_of_segmentation

Segmentation

Features of Segmentation

**1. Variable-sized divisions: Segments can have different lengths, depending on the program’s requirements.
**2. Logical division of memory: Segments represent meaningful units like code, stack, data, or modules.
**3. Two-part address: A logical address consists of:

**4. Protection and sharing: Different segments can have access rights (read, write, execute) and can be shared among processes.
**5. No internal fragmentation: Memory is allocated according to segment size, so there is no unused space within a segment.
**6. External fragmentation: Can occur when free memory is divided into small scattered blocks.

Types of Segmentation

Logical and physical addresses have a well-defined relationship, where the physical address is obtained using the segment table (base + offset).

Segment Table

Used to map a two-part logical address ⟨segment number, offset⟩ to a one-dimensional physical address. Each segment has an entry in the table. Each table entry contains:

Segmentation

Segmentation

Translation of Two-dimensional Logical Address to Dimensional Physical Address.

Translation

Translation

The address generated by the CPU is divided into:

Advantages

Disadvantages