12.7: Segmentation
- Page ID
- 82910
Segmentation in Operating System
A process is divided into segments. The segments are not required to be of the same sizes.
There are 2 types of segmentation:
- Virtual memory segmentation
Each process is divided into a number of segments, not all of which are resident at any one point in time. - Simple segmentation
Each process is divided into a number of segments, all of which are loaded into memory at run time, though not necessarily contiguously.
There is no simple relationship between logical addresses and physical addresses in segmentation. A table stores the information about all such segments and is called Segment Table.

("Segmentation Table Mapping to Physical Address" by VaibhavRai3, Geeks for Geeks is licensed under CC BY-SA 4.0)
The Segment Table maps the logical address, made up of the base address and the limit, into one-dimensional physical address. It’s each table entry has:
- Base Address: It contains the starting physical address where the segments reside in memory.
- Limit: It specifies the length of the segment.
Translation of a two dimensional Logical Address to one dimensional Physical Address.
.png?revision=1)
("Translate Logical Address to Physical Address" by VaibhavRai3, Geeks for Geeks is licensed under CC BY-SA 4.0)
Address generated by the CPU is divided into:
- Segment number (s): Number of bits required to represent the segment.
- Segment offset (d): Number of bits required to represent the size of the segment.
Walking through the diagram above:
- CPU generates a 2 part logival address.
- The segment number is used to get the Limit and the Base Address value from the segment table.
- If the segment offset (d) is less than the Limit value from the segment table then
- The Base Address returned from the segment table, points to the beginning of the segment
- The Limit value points to the end of the segment in physcial memory.
Advantages of Segmentation
- No Internal fragmentation.
- Segment Table consumes less space in comparison to Page table in paging.
Disadvantage of Segmentation
- As processes are loaded and removed from the memory, the free memory space is broken into little pieces, causing External fragmentation.
Adapted from:
"Segmentation in Operating System" by VaibhavRai3, Geeks for Geeks is licensed under CC BY-SA 4.0