Dividing memory into logical segments of variable sizes
Segmentation is a memory management scheme that supports the user's view of memory as a collection of variable-sized segments, each representing a logical unit such as a code segment, data segment, stack segment, or heap segment. Unlike paging which divides memory into fixed-sized units, segmentation divides memory into logical units that correspond to the program's structure. Each segment has a name and length, and addresses specify both a segment name and an offset within that segment. The hardware support for segmentation includes a segment table for each process that contains the base address and limit (length) for each segment. When a process references memory, the segment number is used to find the base address in the segment table, and the offset is checked against the segment limit to ensure it's within bounds. The key advantages of segmentation are that it reflects the logical structure of programs, supports sharing and protection at the segment level, and allows segments to grow dynamically. However, segmentation suffers from external fragmentation as memory becomes filled with variable-sized segments. Modern systems often combine segmentation with paging to get the benefits of both approaches: segmentation for logical organization and protection, and paging for efficient physical memory management without external fragmentation.