The Limits of Standard Tools
Every engineer knows top and htop. They answer the basic question: "Is the CPU busy right now?" That is useful for a quick sanity check, but it is roughly equivalent to checking whether your car engine is running — it tells you nothing about why it is running hot, which cylinder is misfiring, or whether the fuel injector is clogged.
Modern systems fail in subtle ways. A process can be slow not because the CPU is overloaded, but because it is pinned to the wrong core and its memory is physically located on the other side of the motherboard. RAM can disappear without any single process claiming it. Two processes can each appear to consume 500 MB while together they are only actually using 600 MB of physical RAM. Standard tools will not show you any of this.
The tools in this lesson are precision instruments. They require you to understand what you are measuring before you can interpret the output. We will build that understanding from first principles, starting with the physical layout of the CPU, moving through the kernel's own memory usage, and finishing with the true cost of a single process.
The questions these tools answer:
- "Is my application slow because it is running on the wrong CPU core?" →
lscpu,lstopo - "Why is 50% of my RAM gone, but no process seems to be using it?" →
slabtop - "Is this process actually using 1 GB of RAM, or is it just sharing that 1 GB with 10 other processes?" →
/proc/[pid]/smaps