CHAPTER 16 TAKING CONTROL OF THE (Free web hosts) SYSTEM
CHAPTER 16 TAKING CONTROL OF THE SYSTEM 259 Table 16-1. The top Program Process Information Column Description NI This column shows the nice value of the process. This refers to how charitable a process is in its desire for CPU time. A high figure here (up to 19) indicates that the process is willing to be interrupted for the sake of other processes. A negative value means the opposite: the process is more aggressive than others in its desire for CPU time. Some programs need to operate in this way, and this is not necessarily a bad thing. VIRT This column shows the amount of virtual memory used by the process.1 RES This column shows the total amount of physical memory used.1 SHR This column shows the amount of shared memory used. This refers to memory that contains code that is relied on by other processes and programs. S This column shows the current status of the task. Generally, the status will either be sleeping, in which case an S will appear, or running, in which case an R will appear. Most processes will be sleeping, even ones that appear to be active. Don t worry about this; it just reflects the way the Linux kernel works. A Z in this column indicates a zombie process (a child of a process that has been terminated). %CPU This column shows the CPU use, expressed as a percentage.2 %MEM This column shows the memory use, again expressed as a percentage.2 TIME+ This column shows a measure of how long the process has been up and running. COMMAND This shows the actual name of the process itself. 1 Both VIRT and RES are measured in kilobytes unless an m appears alongside the number; in which case, you should read the figure as megabytes. 2 The %CPU and %MEM entries tell you in easy-to-understand terms how much of the system resources a process is taking up. This list will probably be longer than the screen has space to display, so top orders the list of processes by the amount of CPU time the processes are using. Every few seconds, it updates the list. You can test this quite easily. Let your PC rest for a few seconds, without touching the mouse or typing. Then move the mouse around for a few seconds. You ll see that the process called Xorg leaps to the top of the list (or appears very near the top). Xorg is the program that provides the graphical subsystem for Linux, and making the mouse cursor appear to move around the screen requires CPU time. When nothing else is going on, moving the mouse causes Xorg to appear as the number one user of CPU time on your system. Tip Typing d while top is running lets you alter the update interval, which is the time between screen updates. The default is three seconds, but you can reduce that to one second or even less if you wish. However, a constantly updating topprogram starts to consume system resources and can therefore skew the diagnostic results you re investigating. Because of this, a longer, rather than shorter, interval is preferable.