Module 2: Memory Management & Virtual Memory: Mistake Clinic
This clinic turns wrong moves into reusable judgment. Use it after each practice page and again before the quiz or checkpoint.
Module-Specific Mistake Radar
Start with these traps. Replace or extend them with real mistakes from your own work.
| Mistake to look for | Where it shows up | Symptom | Repair evidence |
|---|---|---|---|
| Finishing Page Fault and TLB Measurement Lab with only a final answer | Page Fault and TLB Measurement Lab | The work has no failed case, trace, test, proof gap, or design stress point. | Add the smallest broken example and show the repair that changes the result. |
| Finishing Page Replacement Simulator Workshop with only a final answer | Page Replacement Simulator Workshop | The work has no failed case, trace, test, proof gap, or design stress point. | Add the smallest broken example and show the repair that changes the result. |
| Finishing Allocator Comparison Clinic with only a final answer | Allocator Comparison Clinic | The work has no failed case, trace, test, proof gap, or design stress point. | Add the smallest broken example and show the repair that changes the result. |
| Finishing Code Katas with only a final answer | Code Katas | The work has no failed case, trace, test, proof gap, or design stress point. | Add the smallest broken example and show the repair that changes the result. |
| Treating Physical vs Virtual Addresses: Why We Need Translation as vocabulary instead of a tool | Physical vs Virtual Addresses: Why We Need Translation | The explanation names the concept but cannot decide between two cases. | Write one example, one non-example, and the rule that separates them. |
| Treating Base/Bounds and Segmentation: The First Answer as vocabulary instead of a tool | Base/Bounds and Segmentation: The First Answer | The explanation names the concept but cannot decide between two cases. | Write one example, one non-example, and the rule that separates them. |
Practice Mistake Checks
Pull any miss from these checks into your mistake log.
Page Fault and TLB Measurement Lab
Source: practice/01-page-fault-and-tlb-measurement-lab.md
Identify the error in each statement:
- "The program is slow because of page faults." (when
perf statshows 20 faults total) - "Linux does not use LRU so I do not need to worry about replacement policies."
- "A huge page eliminates TLB misses."
- "
perf statshows 1 billion TLB loads, so the program has 1 billion TLB misses." - "Adding RAM to the machine always reduces minor-fault count."
Page Replacement Simulator Workshop
Source: practice/02-page-replacement-simulator-workshop.md
Identify the error:
- "OPT is the policy with the lowest fault rate, so we should use it in production."
- "FIFO never outperforms LRU."
- "Adding more frames always reduces fault count."
- "The working set and the resident set size are the same."
- "A policy with a lower miss rate is always better, regardless of implementation cost."
Allocator Comparison Clinic
Source: practice/03-allocator-comparison-clinic.md
Identify the error:
- "I called
free, so the RSS should drop immediately." - "
glibcmalloc is slow because it is old; newer allocators will always be faster." - "Switching allocators is risky because it changes program behavior."
- "Valgrind says no leaks, so the growing RSS is not caused by allocations."
- "The allocator only matters for multithreaded programs."
Repair Protocol
For each real mistake:
- Reproduce the failure on the smallest example, trace, proof, query, command, or design sketch.
- Name the hidden assumption.
- Repair the artifact.
- Save evidence that changed: failing then passing test, corrected proof step, revised diagram, safer command, benchmark, or review note.
- Add one retrieval card beginning with Check... before... or Do not use... when....
Mistake Log
| Date | Mistake | Symptom | Root cause | Repair evidence | Retrieval card |
|---|---|---|---|---|---|
| Starter | Pick one radar row above | Explain how it would fail in this module | Name the assumption | Add a counterexample or corrected artifact | Write the card before closing the page |
Completion Standard
- At least five real mistakes are logged.
- At least two mistakes include a counterexample or failing test.
- At least one mistake connects to an older semester skill.
- At least one correction changes code, a proof, a diagram, a command transcript, a query, or a design decision.