This article is about segmented computer memory. For segments in object code, see Object file. This article includes segmentation with paging in operating system pdf list of references, but its sources remain unclear because it has insufficient inline citations.
Please help to improve this article by introducing more precise citations. Memory segmentation is the division of a computer’s primary memory into segments or sections.
Segments or sections are also used in object files of compiled programs when they are linked together into a program image and when the image is loaded into memory. Segments usually correspond to natural divisions of a program such as individual routines or data tables so segmentation is generally more visible to the programmer than paging alone.
Different segments may be created for different program modules, or for different classes of memory usage such as code and data segments. Certain segments may be shared between programs. In a system using segmentation, computer memory addresses consist of a segment id and an offset within the segment. A process is only allowed to make a reference into a segment if the type of reference is allowed by the permissions, and if the offset within the segment is within the range specified by the length of the segment.