OS Memory Allocation Simulator
3D Dynamic Partition Visualization ยท Choose your experience
โšก
Basic Mode
Learn First Fit, Best Fit & Worst Fit with clear 3D animation. Perfect starting point.
Recommended First
๐Ÿ”ฌ
Advanced Mode
Real block splitting, coalescing, compaction & fragmentation analysis.
After Basic
๐Ÿ’ก We recommend starting with Basic Mode. Once you understand how processes are allocated and freed, switch to Advanced Mode to explore real OS concepts like block splitting, external fragmentation, and memory coalescing.
๐Ÿ“š Concept Guide
First Fit
Scans memory blocks from left to right and picks the first block that has enough free space. It is the fastest algorithm because it stops searching as soon as it finds a match.
Blocks: [100K free] [500K free] [200K free]
Request: 80 KB โ†’ picks Block 0 (first fit)
Block 0 used: 80 KB, still 20 KB free
Best Fit
Searches all free blocks and picks the smallest one that still fits the request. Minimises wasted space per allocation, but can leave many tiny unusable fragments over time.
Blocks: [100K free] [500K free] [200K free]
Request: 80 KB โ†’ picks Block 0 (100K, leftover only 20K)
Leaves the fewest wasted KB
Worst Fit
Picks the largest available free block. The large leftover piece is more likely to be useful for future allocations, reducing very-small unusable fragments.
Blocks: [100K free] [500K free] [200K free]
Request: 80 KB โ†’ picks Block 1 (500K, leftover 420K)
Leaves the biggest remainder for future use
Memory Block
A fixed region of RAM represented as a tall 3D bar in the scene. Each block has a total capacity (KB). Processes stack inside a block as coloured segments. When a process is freed, its space returns to the block.
Block 2 = 200 KB total
P1(100K) + P2(60K) inside โ†’ 40 KB still free
Process Allocation & Freeing
Click โ–ถ Allocate to load a new process into memory. The simulator animates the search across all blocks. Click the โœ• button on any active process in the Memory Grid table to release it back to free space.
Allocate P3(150KB) โ†’ algorithm scans blocks
Found Block 1 with 180KB free โ†’ P3 placed
Free P3 โ†’ Block 1 gets 150KB back
๐Ÿ“– Simulator Instructions
๐Ÿ–ฅ๏ธ What is this Simulator?

This is a 3D Operating System Memory Allocation Simulator. It visually demonstrates how an OS manages RAM โ€” allocating memory to processes, detecting fragmentation, and reclaiming space. The 3D blocks represent memory partitions. Taller blocks = more memory used.

โšก Mode Switcher (Top Center)
โšก Basic
Basic Mode โ€” Great for beginners. Shows 5 fixed memory blocks. Processes stack inside them. Learn how First Fit, Best Fit, and Worst Fit algorithms search for space. Blocks glow red/green as they're checked.
๐Ÿ”ฌ Advanced
Advanced Mode โ€” Realistic simulation. Blocks split when allocated (real OS behavior). Enables fragmentation analysis, coalescing, compaction, waiting queue, and algorithm comparison panel.
๐ŸŽ›๏ธ Left Panel โ€” Controls
Algorithm
Algorithm Selector โ€” Choose how the OS searches for a free block:
โ€ข First Fit: picks the first block with enough space (fastest)
โ€ข Best Fit: picks the smallest sufficient block (least waste)
โ€ข Worst Fit: picks the largest block (leaves big remainders)
Process Size
Process Size (KB) โ€” Type how much memory (10โ€“600 KB) you want to allocate.
โ–ถ Allocate
Allocate Process โ€” Runs the selected algorithm and drops a new colored process block into memory. Watch the 3D scan animation!
โ†บ Reset
Reset Memory โ€” Clears everything and returns memory to fully free state.
โฌก Coalesce
Coalesce Free Blocks (Advanced only) โ€” Merges adjacent free blocks into one larger block.
โŠž Compact
Compact Memory (Advanced only) โ€” Shuffles all live processes to the front of memory, creating one large contiguous free block at the end.
๐Ÿ“‹ Terminal Log & Export
Terminal Log
Top-right panel โ€” Live log of every action the OS takes: which blocks were checked (โœ“/โœ—), where processes land, splitting events, fragmentation alerts, and free operations.
PDF Export
PDF Export button โ€” Saves a full report of current memory state + terminal log as a downloadable PDF.
๐ŸŽฎ Camera Controls
Mouse
Left-drag โ€” Rotate the 3D view
Right-drag โ€” Pan
Scroll wheel โ€” Zoom in and out
โ–ฃ Memory Grid (Bottom Right)
Grid Table
Memory Grid State โ€” A table showing every block/segment: its segment number, address range, size, and current state (FREE or which process). Click Free to deallocate a specific process instantly.
๐ŸŽ™ Voice Tutorial
Select a topic to hear an audio explanation
๐Ÿ–ฅ๏ธ
Simulator Overview
What this tool does and how to start
๐Ÿ”
Allocation Algorithms
First Fit, Best Fit & Worst Fit explained
๐Ÿงฉ
Fragmentation
Internal vs External fragmentation
๐ŸŽฎ
How to Use This Simulator
Step-by-step usage walkthrough
Step 1 of 6
Welcome!
Let's take a tour.
Live Engine v5.0 ยท Basic
OS Memory Simulator
Dynamic Partition Allocation ยท 3D
Algorithm
Process Size (KB)
KB
Total
1700 KB
Free
1700 KB
Used
0 KB
Procs
0
๐ŸŽฎ Camera Controls
Left-drag โ†’ Rotate   Right-drag โ†’ Pan
Scroll โ†’ Zoom in / out
Terminal Log
โ–ฃ Memory Grid State
Seg Addr Size State Action