What happens when memory runs out?
Lesson 8.4 · When the Desk Is Full
Sarah · Jenny
Nineteen tabs. One printer app for a printer that’s gone.
Sarah sorts Task Manager by memory.
The top line is the web browser, with nineteen tabs Grandma Ruth never closed, then an antivirus program from 2016, then a printer app for a printer she doesn’t own anymore.
Memory sits at 91%. Disk sits at 100%.
Jenny says those two numbers are connected, and that the laptop is doing something desperate.
The short answer
The laptop starts swapping memory onto the drive. On Grandma Ruth’s spinning hard drive, every swap is a months-long trip in processor time, so the disk is pinned at 100% and the processor sits waiting. Close the tabs, quit the zombie apps, and things get better. A faster drive and more RAM would make it much better. That’s Modules 9 to 11.
Try it yourself
Read Task Manager and pick the fix.
1 of 1 Grandma Ruth’s laptop
| Running | Processor | Memory | Disk |
|---|---|---|---|
| Web browser (19 tabs) | 6% | 48% | 12% |
| Old antivirus scan | 4% | 14% | 41% |
| System (swapping memory to disk) | 2% | 4% | 38% |
| Printer helper app | 1% | 9% | 3% |
What would you fix first?
What you just did has a name
Swapping
Swapping is what a computer does when memory fills up: it moves things it hasn’t used lately out of RAM and onto the drive, then swaps them back when they’re needed.
Windows calls that space on the drive the page file. Macs and Linux call it swap.
It keeps the computer from crashing, but every swap is a trip down the speed ladder, and on a spinning hard drive that makes everything crawl.
A few more things
Disk at 100% is a clue
When memory is nearly full and the disk is pegged, the computer is probably swapping. The fix is less in memory or more memory, not a faster processor.
SSDs make swapping bearable
Swapping to an SSD is still slower than real memory, but nowhere near as painful as a spinning drive. Module 11 picks that up.
Phones just close apps
Phones usually don’t swap much. When memory is tight, they quietly close apps you haven’t used in a while. That’s why an app sometimes restarts when you switch back to it.
Go deeper
The longer version, if you want it.
Thrashing
If memory is badly overfull, the computer can spend nearly all its time swapping: moving one thing out to make room, then needing it again a moment later and moving it back. Almost no real work gets done. It’s called thrashing, and the computer feels frozen even though the drive light never stops.
Apollo 11’s computer had a smarter answer to overload: drop the least important jobs. Modern operating systems do a version of that too, but the best fix is still not to fill the desk in the first place.
Quick check
Memory is at 95% and disk is at 100%. What’s most likely happening?
Let’s take it slower
Your desk is covered, so every time you need a new paper you have to carry an old one down to the basement first. Then you need the old one again and back down you go. You spend all afternoon on the stairs and none of it working. That’s swapping. Clear the desk or get a bigger one, and the stairs stop.
More examples
Fifty tabs and a video call
A laptop with 8 GB of RAM, fifty tabs and a video call starts swapping. The call gets choppy, not because of the internet, but because of the desk.
The fresh restart
Right after a restart, memory is mostly empty and everything feels quick. Over a week of never closing anything, it fills up and starts swapping.
Back to the question
So what happens when memory runs out?
Show the answer
The laptop starts swapping memory onto the drive. On Grandma Ruth’s spinning hard drive, every swap is a months-long trip in processor time, so the disk is pinned at 100% and the processor sits waiting. Close the tabs, quit the zombie apps, and things get better. A faster drive and more RAM would make it much better. That’s Modules 9 to 11.
More on this: What is RAM, and how much do you need?
One last question
Rob asks why the laptop gets slower the longer it’s been on. Who got it right?
Talk Card
Talk Card · 8.4
When RAM fills up, the computer swaps things onto the drive. It doesn’t crash, but everything slows to the drive’s speed. Close stuff, restart, or add RAM.
How Computers Work · pettigrewlab.com/learn

