The problem

A slow laptop is a symptom; four parts can be the limit

The laptopCPU8 coresMemory16 GBSSD512 GBAge2 yearsVideo callsstutter and freezeA build takes9 min, was 4 minThe tempting answer“It is two years old. It needs replacing.”The method: measure first, then decide.A slow machine is a symptom. Four parts can be the limit: processor, memory, disk or heat.A developer’s laptop has 8 cores, 16 GB of memory and a 512 GB SSD, and is 2 years old. Video calls stutter, and a build thattook 4 minutes now takes 9. The easy answer is a new laptop. Step 1 of the method is to collect facts instead: what is slow,since when, and what changed. Then measure every resource before blaming one.

Calls stutter and a build takes 9 minutes, not 4. Before replacing anything, measure.

Measure first

Read every gauge before naming a cause

Task Manager (Windows) or Activity Monitor (macOS), during a build, each bar as a share of its maximumCPU busy35%Memory used15.4 of 16 GBDisk busy100%, swap file 6 GBSSD space used94%, 31 GB freeCPU temperature98 °C of 100 °C limitClock speed1.2 of 4.4 GHzRead every gauge before naming a cause. Three are at their limit, and the processor is not one of them.The processor is only 35% busy. Memory is 15.4 of 16 GB, with 6 GB pushed out to the swap file, and the disk is busy 100% of the timeon an SSD that is 94% full. The CPU is at 98 °C and running at 1.2 GHz instead of up to 4.4. These readings take two minutes tocollect and they already point away from the first guess.

CPU 35% busy. Memory full with 6 GB of swap, disk busy 100%, and the CPU throttled to 1.2 GHz.

The first guess

A processor that mostly waits is not the limit

“The processor is too slow”so buy a faster one✗ ruled out by one readingWhat the processor does with its time, to scaleworking 35%waiting 65%, for memory pages from the diskA processor that waits two thirds of the time is not the limit.A faster one would wait faster. In most laptops it is soldered anyway.A busy processor is the limit; one that is mostly idle is waiting for something else.At 35% the processor has nothing to do for 65% of every second. Something slower is holding each program back, and the readingsalready show what: the disk is busy all the time, and memory is full. Buying a faster processor would change almost nothing,and it would cost most of a new laptop. The first guess is dropped because a reading disproves it.

At 35% busy the processor waits 65% of the time. A faster one would wait faster.

The cause

Memory runs out, the disk stands in, and everything waits

Memory full15.4 of 16 GBPages swapped6 GB to the SSDDisk saturatedbusy 100%Every program waitscalls stutterMade worse byan SSD 94% full: little free space left to write swap into quicklyA second causeDust in the ventsCPU at 98 °Cclock cut to 1.2 GHz, 27% of its top speedBiggest use of memorybrowser with 60 tabs 6.2 GB, and a virtual machine 4 GB left running after a testThe real limit is memory. When it runs out, the disk stands in, and the disk is a thousand times slower.Programs asked for more than 16 GB, so the operating system moved 6 GB of their memory pages to the swap file. Every time a program needsone back, it waits for the disk, which is now busy all the time. A nearly full SSD makes those writes slower still. Separately, dust hasblocked the vents, so the CPU slows itself down to stay under its temperature limit. Two causes, both found by reading, not by guessing.

Memory full, 6 GB swapped, disk saturated. Separately, dust makes the CPU throttle to 1.2 GHz.

The fix

Fix the cause, then read the same gauges again

BeforeAfterMemory used15.4 GB10.8 GBSwap in use6 GB0.4 GBDisk busy100%12%SSD space used94%70%, 154 GB freeClock speed1.2 GHz4.0 GHz at 81 °CBuild time9 min4.5 minFix the cause, then check the same readings again. The build is back near where it started.Shut down the virtual machine when it is not in use and close the tabs that are not needed: memory drops to 10.8 GB and swap nearlyempties. Clear old downloads and caches until the SSD is 70% full. Clean the vents with compressed air: the CPU runs at 81 °C and 4.0 GHz.The build takes 4.5 minutes again, and calls are smooth. Verifying with the same readings proves the fix, not a feeling.

Shut the VM, close tabs, clear the SSD to 70%, clean the vents. The build takes 4.5 minutes again.

The trade-off

The cheapest fix that removes the cause comes first

OptionCostEffortMemoryHeatLastsChange habits, clean ventsnothingan hour✓✓only if habits holdAdd memory, 16 to 32 GBone partan hour✓✗if the laptop has a slotA new laptopthe mosta day to set up✓✓years; wasteful nowChosen: change habits and clean the vents now; add memory only if work alone fills it again.The cheapest fix that removes the cause comes first. Keep the bigger fix for when the readings ask for it.More memory would also stop the swapping, but many thin laptops have memory soldered to the board, so check the specification first.It would not fix the heat. A new laptop fixes everything and costs the most, for a machine that works once cleaned. The habit fix isfree but can slip, so the readings are written down as a baseline to compare against next time.

Habits and cleaning cost nothing. More memory needs a free slot. A new laptop costs the most.

The method

Six steps, the same for every fault

1 Identify the problemwhat is slow, since whenLesson 12: the method2 Form a theoryread every gauge firstLesson 3: processor and memory3 Test the theoryswap and disk busy confirm itLesson 4: storage4 Plan and fixclose, clear, cleanLesson 6: the operating system5 Verify and preventsame readings, startup appsLesson 8: Windows, Linux, macOS6 Documentcause, fix, baselineLesson 12: professional practiceEach step opens the lesson that teaches it.The same six steps fix a slow laptop, a dead printer or a crash. The readings change; the order does not.This case spent most of its time on step 2, and that is normal: one look at every gauge removed the wrong guess before any moneywas spent. Steps 5 and 6 are the ones people skip. Verifying with the same readings proves the fix, and a written baseline makesthe next slowdown a two-minute comparison.

Identify, theory, test, fix, verify, document. Each step links to the lesson that teaches its reading.

A real case

At Netflix, a slow server gets ten checks in a fixed order

Netflix’s first 60 seconds on a slow Linux server, in order1uptimeload averages2dmesg | tailkernel errors, out of memory3vmstat 1run queue, swapping4mpstat -P ALL 1each CPU5pidstat 1each process6iostat -xz 1disk busy and waits7free -mmemory8sar -n DEV 1network traffic9sar -n TCP,ETCP 1TCP and retransmits10topa last overviewAt Netflix, a slow server gets the same ten checks in the same order before anyone names a cause.Netflix’s performance engineers published the commands they run in the first minute on a slow Linux server. They look at errorsand saturation first, because those are easy to read, then at how busy each resource is. On our laptop, three of the ten would havenamed the cause at once: vmstat shows the swapping, iostat shows the disk at 100%, and free shows memory full.

Netflix checks errors and saturation first, then utilization. vmstat, iostat and free would have named our cause.

Lesson complete

You finished “The laptop got slow”

Nicely done.

Open in a new tab