Process Memory Layout Diagram

This visual model shows the major regions of a Linux process virtual address space after a program has been loaded and is running.

                    Process Virtual Address Space

High Addresses
┌────────────────────────────────────────────────────┐
│                    Stack                           │
│   Function calls, local variables, return paths    │
│                    ↓ grows downward                │
├────────────────────────────────────────────────────┤
│                                                    │
│                    mmap()                          │
│   Shared libraries, mapped files, anonymous maps   │
│                                                    │
├────────────────────────────────────────────────────┤
│                    ↑ grows upward                  │
│                    Heap                            │
│   malloc(), new(), dynamically allocated memory    │
├────────────────────────────────────────────────────┤
│                    BSS                             │
│   Uninitialized global/static data                 │
├────────────────────────────────────────────────────┤
│                    Data                            │
│   Initialized global/static data                   │
├────────────────────────────────────────────────────┤
│                    Text                            │
│   Program instructions / executable code           │
└────────────────────────────────────────────────────┘
Low Addresses

How to Read This

The process sees one continuous virtual address space, but Linux maps those virtual regions onto physical memory as needed.

The stack usually grows downward from higher addresses, while the heap grows upward as the program asks for dynamic memory. The mmap region is used for shared libraries, mapped files, and large or anonymous mappings.

Return

← Back to Stack, Heap, mmap Deep Study

← Back to Narrative Memory Layout Section