Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Supported Platforms

CPU Load runs on Linux, Windows, macOS and FreeBSD, on PCs, servers, Macs and single-board computers such as the Raspberry Pi. It reads what the operating system counts, not the hardware, so it works the same whatever the processor.

What is measuredOSMethod
The whole systemLinuxThe cpu line of /proc/stat
The whole systemmacOShost_statistics, macOS’ CPU counters
The whole systemWindowsGetSystemTimes
The whole systemFreeBSDkern.cp_time through sysctl
One process, by its numberLinuxutime + stime of /proc/<pid>/stat
One process, by its numbermacOSproc_pidinfo, the user and system time of the process
One process, by its numberWindowsOpenProcess + GetProcessTimes
One process, by its numberFreeBSDkern.proc through sysctl, the CPU time of the process
An application, every process of itLinux/proc scanned, each process named by /proc/<pid>/exe
An application, every process of itmacOSproc_listpids, each process named by proc_pidpath
An application, every process of itWindowsEnumProcesses + QueryFullProcessImageNameW
An application, every process of itFreeBSDkern.proc listed, each process named by kern.proc.pathname

FreeBSD is supported on 64-bit systems only.

Matching an Application

An application is given by the name of its program, without its folder. The name must match exactly, but upper or lower case does not matter. Every OS matches the program with the process that actually runs, so firefox finds every process of Firefox, its content processes included.

Linux
A process is named by the program /proc/<pid>/exe points to. A process whose /proc/<pid>/exe cannot be read (such as a kernel thread, which runs no program directly, or another user’s process) falls back on /proc/<pid>/comm: the name the process was given, cut to 15 characters.

macOS
A process is named by the program inside the bundle, so firefox finds the application inside Firefox.app, and also every program inside Firefox.app: for example, its content processes run plugin-container, from a helper bundle inside it.

Windows
A trailing .exe is ignored, so firefox also finds firefox.exe.

FreeBSD
A process is named by the program kern.proc.pathname gives. A process whose program cannot be named (a kernel process, which runs none, or a process whose program was replaced while it runs) falls back on its command name, cut to 19 characters.

Macs

macOS is supported on Apple Silicon and Intel Macs, with the library built for the chip it runs on. An x86_64 build running under Rosetta on an Apple Silicon Mac reads process times about 40 times too low, so process and application loads come out close to 0%.