Chapter 8 · Simulation

Memory Allocation

← Chapter 8
Speed 0.75/s
Holes
Queue
Requests
cursor
History

Free 0 Largest 0 Ext. frag. 0 ✗ Failed 0 Step 0/0

Memory Allocation

Variable-partition contiguous allocation: a queue of requests (A=120 allocates 120 units to A; -A frees A) is served by first fit, best fit, worst fit or next fit. The memory map shows holes, processes and the blocks reserved for the operating system (OS); during a step the candidate holes are checked one by one. The history below has one row per request; the side panel lists the holes in address order and the state of each process.

Usage

  • Pick an algorithm and an initial hole layout (Default, Fragmented, Large).
  • Edit the requests directly, add (+) or clear (×) them (up to 24), or load a preset queue.
  • ▶ plays; the step buttons move one request back or forward, or jump to the start or end. Clicking a row in the history jumps to that step.
  • Compare runs the four algorithms on the same queue and shows the final memory maps and external fragmentation.

Algorithms

First
First fit: the first hole that is large enough.
Best
Best fit: the smallest hole that is large enough.
Worst
Worst fit: the largest hole.
Next
Next fit: the first fit, starting at the cursor (just after the last allocation) and wrapping around.
Ext. frag.
External fragmentation: total free memory minus the largest hole.

Queue

A=120
Allocate 120 units to A.
-A
Free A; neighboring holes merge.

Legend

hole process OS (reserved) ✓ fits ✗ too small ★ best so far ▼ next-fit cursor

Keys

←→ stepSpace playHomeEndEsc close