A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Memory Management Fundamentals

College Depth 94 in the knowledge graph ☐ I know this ☆ Set as goal
29topics build on this
354prerequisites beneath it
See this on the map →
Memory HierarchyMemory Organization and Addressing→→Activation Records and Stack FramesAlias Analysis and Memory Disambiguation+6 more
logical-address physical-address address-binding MMU relocation

Core Idea

Memory management is the OS subsystem responsible for tracking which memory is in use, allocating memory to processes, and reclaiming it when processes terminate. A key abstraction is the separation between logical addresses (the address a program generates, also called virtual addresses) and physical addresses (the actual location in RAM). Address binding — mapping logical to physical — can occur at compile time, load time, or execution time; execution-time binding via hardware (the Memory Management Unit, MMU) is used by modern systems because it allows the OS to relocate a process freely. The MMU performs address translation on every memory access, enabling isolation and protection between processes.

How It's Best Learned

Trace how a pointer dereference in a C program becomes a physical memory access: compiler generates logical address, MMU translates, physical RAM is accessed. Then explain why two processes can have the same logical address but different physical locations.

Common Misconceptions

Explainer

When a program runs, it constantly refers to memory addresses — to read variables, call functions, and access data structures. But here is the key insight: the address a program generates (a *logical* address) is not the address where its data actually lives in RAM (the *physical* address). These two address spaces are intentionally kept separate, and the hardware unit that bridges them on every single memory access is the Memory Management Unit (MMU).

Why go to this trouble? Consider what happens when two programs are both running. Both might generate the address `0x4000` in their own code — perhaps both have a variable at the start of their memory. If these addresses referred directly to RAM, the two programs would collide. Instead, the OS configures the MMU with a different mapping for each process: process A's `0x4000` maps to physical address `0x10000`, while process B's `0x4000` maps to `0x20000`. Each process is isolated in its own logical address space, invisible to the other.

Address binding — the act of deciding where in physical memory a logical address maps — can happen at different times. Compile-time binding bakes physical addresses into the binary, which is inflexible and essentially requires the program to always load at the same location. Load-time binding sets addresses when the program is loaded into memory, which is more flexible but still commits to a fixed location for the entire run. Execution-time binding, used by all modern systems, defers the mapping to the MMU hardware and allows the OS to move a process freely at any time. This flexibility is what makes paging, segmentation, and virtual memory possible.

One critical distinction to keep straight: the MMU is hardware, not software. It is a physical chip (integrated into the CPU on modern processors) that intercepts every memory access and performs the logical-to-physical translation at wire speed. The OS *configures* the MMU by writing mapping tables (page tables) into memory, but the translation itself happens in hardware with no software involvement. This is why the overhead of address translation is negligible — the MMU does it in the same clock cycles as the memory access itself.

Memory management is the foundation on which everything else in an OS rests. Paging divides logical and physical memory into fixed-size pages and frames. Segmentation divides by logical region (code, stack, heap). Virtual memory extends these ideas to allow processes to use more address space than physical RAM exists. All of these build on the core abstraction you have just learned: logical addresses are a program's view of memory, physical addresses are reality, and the MMU is what connects them.

Practice Questions 3 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Binary Counters: Design and Analysis → Binary Arithmetic → Fixed-Point Number Representation → Two's Complement Representation → Overflow and Underflow Detection → Binary Adders: Half-Adders and Full-Adders → Full Adder and Carry Propagation → Carry Lookahead Adder Design → Half Adder Circuit Design → Multiplication Circuit Design → Sequential Circuit Design → Registers and Register Files → Instruction Set Architecture (ISA) → Assembly Language Basics → Memory Organization and Addressing → Memory Hierarchy → Memory Management Fundamentals

Longest path: 95 steps · 354 total prerequisite topics

Prerequisites (2)

Leads To (8)