> For the complete documentation index, see [llms.txt](https://davidjosearaujo.gitbook.io/notes-miect/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://davidjosearaujo.gitbook.io/notes-miect/sistemas-de-operacao/memory-management/segmentation.md).

# Segmentation

## Introduction

Typically, the logical address space of a process is composed of different type of segments:

* **code** – one segment per code module.
* **static variables** – one segment per module containing static variables.
* **heap memory** – one segment.
* **shared memory** – one segment per shared region.
* **stack** – one segment.
* Different segments may have different sizes.

In a **segmentation architecture**, the segments of a process are manipulated separately.

* **Dynamic partitioning** may be used to allocate each segment.
* As a consequence, a process may not be contiguous in memory.
* Even, some segments may not be in main memory.

<figure><img src="https://933056030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmDWmJ4LyRblScRPGY3di%2Fuploads%2FeRhUpJ0OeR4TQZmsRGoH%2Fa.png?alt=media&amp;token=c9113eac-6ea6-4c55-9343-ef7f47b552e9" alt=""><figcaption></figcaption></figure>

## Memory management unit (MMU)

<figure><img src="https://933056030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmDWmJ4LyRblScRPGY3di%2Fuploads%2FeMguBJHYs5JylV8kOHzC%2Fa.png?alt=media&amp;token=71a9d889-2b7a-411b-a3ad-abdc3db93db9" alt=""><figcaption></figcaption></figure>
