🧠

Dynamic Memory Management Visualizer

OS Project — Paging · Segmentation · Virtual Memory · Allocation

Space = VM step  |  R = Reset
📄 Paging
▦ Segmentation
🔄 Virtual Memory
📂 Allocation
Paging: Physical memory split into fixed-size frames (16B here). Virtual memory split into same-size pages. A page table maps VPN→PFN. VA = VPN×PageSize + Offset  |  PA = PFN×PageSize + Offset
Virtual Address Translation
Page Table — P0
Actions
▶ Translation Process
Physical Memory (16 frames × 16 B = 256 B)
Memory Stats
Page=16B VPN bits=4 Offset bits=4
Segmentation: Memory divided into variable-size logical segments (Code, Data, Heap, Stack). Logical address = (segment#, offset). Segment table stores base and limit per segment. If offset ≥ limit → Segmentation Fault.
Logical Address Translation
Segment Table
#NameBaseLimitRWX
Resize Segment
▶ Translation Process
Physical Memory Layout (256 B)
064128192256
Fragmentation Stats
Virtual Memory: Processes use more memory than physically available. Pages swapped to disk on demand. TLB caches recent VPN→PFN lookups. On page fault, OS loads page using a replacement algorithm: FIFO (oldest), LRU (least recently used), Optimal (furthest future use). Press Space to step.
Setup

 (or press Space)
Reference String
Physical Frames
▶ Page Access Process
TLB (Translation Lookaside Buffer)
VPNPFNAge
Replacement History
Event Log
Allocation Strategies: First Fit — pick first hole that fits (fast, O(n)). Best Fit — smallest sufficient hole (less waste, but slow). Worst Fit — largest hole (leaves bigger remainders). Free then coalesce neighbours. Compact to eliminate external fragmentation.
Memory Map (256 B)
064128192256
IDStartSizeStatus
Allocate
▶ Allocation Process
Stats
Algorithm Info
Free Holes
Event Log