Contiguous Memory Allocation

Giving Each Process One Single, Unbroken Block

Contiguous memory allocation gives each process one single, continuous block of physical memory - simple to address (just an offset from the block's starting point), but with meaningful limitations that later memory management techniques were built to solve.

Physical Memory:
+--------+------------+----------+--------+
| OS     | Process A  | Process B| (free) |
+--------+------------+----------+--------+
0       100k         300k       450k    512k

Base and Limit Registers: Enforcing the Boundaries

The CPU uses a base register (where a process's block starts) and a limit register (how large that block is) to translate a process's own internal addresses into actual physical memory addresses, while also enforcing that a process can never access memory outside its own assigned block.

Process's own address: 50
Base register:          300k
Actual physical address: 300k + 50 = 300,050

If the process tried to access address beyond its limit register's range,
the hardware blocks it - preventing it from touching another process's memory.

Why This Provides Real Memory Protection

Because every single memory access is checked against the limit register in hardware, a process simply cannot accidentally (or maliciously) read or write another process's memory - a fundamental protection guarantee that makes running multiple untrusted programs simultaneously actually safe.

The Core Limitation This Approach Has

Requiring one single unbroken block per process means memory can become fragmented over time as processes come and go, and a process's block size cannot easily grow if it needs more memory later - problems covered in depth in the fragmentation and partitioning notes that follow in this section.

Written by Lorens Mishra

Software Engineer Notes Management System Administrator

Discussion

0 comments
Sign in to join the discussion.

No comments yet. Be the first to say something.