Course Overview
What this Memory & Program Execution course covers, how to use it, prerequisites.
Course Overview
This course follows a program from the text you type to the electrons that move when it runs. It starts with bits and bytes, then walks through the compilation pipeline, process memory, variables and lifetimes, function calls, the heap, pointers, buffers, memory bugs, the operating system, the CPU, virtual memory, caches, threads, language runtimes, embedded firmware, linking, debugging tools and current research — and finishes with twenty guided labs and five capstone projects.
By the end you will be able to:
Explain how source code becomes a running program.
Identify the roles of the compiler, assembler, linker, loader, runtime, operating system and CPU.
Explain process memory regions and how stack, heap, static storage, code and mapped memory differ.
Trace variables, addresses, object lifetimes, function calls and control flow.
Understand pointers, references, arrays, structures, dynamic allocation and memory ownership.
Diagnose common memory bugs and interpret the output of debugging tools.
Explain virtual memory, paging, address translation, caches and memory protection.
Understand program startup, executable formats, linking, shared libraries, system calls, threads and context switches.
Analyze performance topics such as locality, alignment, cache behavior, allocation cost and fragmentation.
Apply safe, portable, language-appropriate memory-management practices.
How Every Example Was Run
Nothing in this course is invented output. Every program block was compiled and executed while the course was being built, and the text under Expected output or Output (one real run) is exactly what it printed.
GCC 11.2, -std=c17 -O0 -g -Wall -Wextra -Wpedantic unless a lesson says otherwise
Ubuntu 22.04 on WSL2, x86-64 Linux, glibc 2.35 G++ 11.2, -std=c++20, same warning flags Shell / ELF tools
GNU binutils (readelf, objdump, nm, size), strace, ldd Node.js 24 (V8).NET 10 (dotnet run Program.cs) shown for comparison only — not run (no JDK or Rust toolchain on the build machine)
Two kinds of output appear in the course:
Expected output — deterministic. You will see exactly the same text on the same platform.
Output (one real run) — contains addresses, timings or process IDs. Address-space layout randomization, the scheduler and the hardware make these differ on every run; the *pattern* is what matters, never the exact numbers.
Where behavior depends on the architecture, operating system, compiler or language version, the lesson says so explicitly. The words *typically*, *commonly* and *on this platform* are deliberate.
How to Use This Course
Path. Stage 1 (Beginner) → Stage 2 (Intermediate) → Stage 3 (Advanced) → Stage 4 (Expert & Labs). Each module lists its prerequisites; you can skip a module if you already meet them.
Lesson format. Every module follows the same structure: objectives, prerequisites, a plain-language explanation, the precise technical explanation, key terms, layout or flow diagrams, syntax, a complete runnable example with line-by-line notes and a trace, an interactive visualizer, mistakes, the safe pattern, debugging, performance, security, platform caveats, real-world use, a checklist, three exercises, a quiz with explained answers, a summary and further reading.
Visualizers. Ten interactive simulators — memory map, stack frames, heap allocator, byte viewer, compilation pipeline, CPU, address translation, cache, lifetime/ownership and embedded memory map — appear inside the lessons that use them. They are *teaching models*: simplified, internally consistent, and clearly labelled as simulations rather than measurements of real hardware.
Quizzes. Choose an answer to see whether it is right and why every option is right or wrong. Some questions accept several answers; they say so.
Progress. Mark a lesson complete when you have finished its exercises. Opening a lesson never marks it complete. The course page shows your progress and resumes where you stopped.
Safety. Memory-bug lessons use small, controlled programs that are detected by tools such as AddressSanitizer. They show how to recognise, fix and prevent bugs — never how to exploit them.
Prerequisites
Basic programming in any language: variables, if/loops, functions and simple data types. C syntax is introduced as it is needed; you do not have to be a C programmer before you start.