Using Kpm

The Kpm Handbook
Prev |  | Next

# Chapter 2. Using Kpm

# 2.1. Kpm Start Up

When Kpm starts there are displays showing load, CPU usage, memory usage, swap usage, and uptime, as well as a summarized view of processes.

## 2.1.1. Displays

### 2.1.1.1. Load Display

The load display is a graph indicating the average system load over time. Clicking on the load display will change it to a text-only display that gives exact figures.

### 2.1.1.2. CPU Display

The cpu display is a bar indicating the percent of CPU resources used by user, nice, and sys (system) processes, as well as idle resources. Clicking on the cpu display will change it to a text-only display that gives exact figures (as percentages).

### 2.1.1.3. Memory Display

The mem display is a bar indicating the amount of memory used, buff (buffered), cach (cached), and free. Clicking on the mem display will change it to a text-only display that gives exact figures (in megabytes), along with the total memory avaiable on the system.

### 2.1.1.4. Swap Display

The swap display is a bar indicating the amount of swap space being used. Clicking on the swap display will change it to a text-only display that gives the exact figure (in megabytes), along with the total swap space available on the system.

### 2.1.1.5. Uptime Display

The up display is a text-only display that shows how long the system has been running.

## 2.1.2. Process List

By default, the process list shows all processes with the user fields upon start up. It can also be configured to show only the current user's processes, non-root processes, or running processes, with jobs fields, memory fields, or a custom selected set of fields. The list can be sorted by any field by clicking on the column head. Clicking on the column head again will reverse the order.

### 2.1.2.1. User Fields

PID

  Process ID. Each process has a unique process ID number (PID), starting at 1 and going up. When a new process is created, the next unused PID is allocated. PIDs are (currently) 16-bit signed integers, so they wrap around at 32767.

USER

  Process owner. This is the name of the (real) owner of the process. If the effective user ID of a process is different from the real user ID, this is indicated by a trailing * or +. The * is used when the effective user is the super-user (this usually indicates a binary that is `setuid` to root).

PRI

  Length of next timeslice. This is the maximal length of the process's next timeslice (or what is left of its current timeslice, if it is the currently running process). The number is rescaled to the -20..20 interval, with a smaller number indicating a longer timeslice.

NICE

  Time-sharing priority. The nice value determines how often a process is allowed to run, and the length of its timeslice. The value is in the range -20 to 20, 0 being the default. Lower numbers give more CPU time to a process. Only the super-user may lower the nice value.

SIZE

  Virtual image size of the process (in kilobytes). This is the total size of the image of the process. This includes all code, data, and shared libraries used by the process, including pages that have been swapped out.

RSS

  Resident set size (in kilobytes). This is the size of the part of the process (code and data) that actually resides in RAM, including shared libraries. This gives a fair approximation of how much RAM a process is using.

SHARE

  Shared memory (in kilobytes). This is the amount of memory that the process shares with other processes. It doesn't mean that any of it is actually used by any other process, just that it is possible.

STAT

  State of the process. At any time, the process is in one of the following states:

  R

    The process is running on a CPU or is ready to run.

  S

    The process is waiting for an event to occur (such as I/O or a timer).

  D

    The process is waiting for an event to occur, without being interruptible (usually waiting ina device driver).

  T

    The process is stopped, or being traced by another process.

  Z

    The process has terminated, but the parent process is not yet aware.

  W

    The process is completely swapped out (that is, it has no resident pages). This is also true for kernel processes, such as `kswapd`.

%CPU

  Percentage of CPU since last update. This is how much of the CPU time the process used since the last update of Kpm's process table.

%MEM

  Percentage of memory used. This is the percent of the total RAM that is used by the process (as resident size). Shared libraries are included, so this is an overstatement.

TIME

  Total CPU time used. This is how much CPU time the process has used since it was started.

CMDLINE

  Command line that started the process. This the command line, including arguments, that started the process. Processes swapped out may show just the command name in parentheses. This is true for kernel processes as well.

### 2.1.2.2. Jobs Fields

PID

  Process ID. Each process has a unique process ID (PID) number, starting at 1 and going up. When a new process is created, the next unused PID is allocated. PIDs are (currently) 16-bit signed integers, so they wrap around at 32767.

PPID

  Parent process ID. Every process has one parent process. The exception is process 1 (`init`), which is the root of the process hierarchy; it has no parent.

PGID

  Process group ID. Each process is member of one process group. Process groups are used for distribution of signals and by terminals to arbitrate requests for their input. Processes that have the same process group as the terminal are foreground and may read, while others will block with a signal if they attempt to read.

SID

  Session ID. Session IDs are used mainly to determine what happens at terminal hangups.

TTY

  Controlling tty. The controlling terminal (tty) is usually the device (serial port, pty, etc.) from which the process was started, and which it uses for input or output. Not all processes have a controlling terminal. Kpm scans the `/dev` directory to determine the name of the terminal, but this might fail. To save space, only the two last characters of the tty name are shown (thus `/dev/ttyp6` is shown as p6).

TPGID

  Process group ID of tty owner. A tty in use is owned by a process. This is the PGID of that process.

STAT

  State of the process. At any time, the process is in one of the following states:

  R

    The process is running on a CPU or is ready to run.

  S

    The process is waiting for an event to occur (such as I/O or a timer).

  D

    The process is waiting for an event to occur, without being interruptible (usually waiting in a device driver).

  T

    The process is stopped, or being traced by another process.

  Z

    The process has terminated, but the parent process is not yet aware.

  W

    The process is completely swapped out (that is, it has no resident pages). This is also true for kernel processes, such as `kswapd`.

UID

  Numerical user ID. This is the ID of the (real) owner of the process.

TIME

  Total CPU time used. This is how much CPU time the process has used since it was started.

CMDLINE

  Command line that started the process. This the command line, including arguments, that started the process. Processes swapped out may show just the command name in parentheses. This is true for kernel processes as well.

### 2.1.2.3. Memory Fields

PID

  Process ID. Each process has a unique process ID (PID) number, starting at 1 and going up. When a new process is created, the next unused PID is allocated. PIDs are (currently) 16-bit signed integers, so they wrap around at 32767.

TTY

  Controlling tty. The controlling terminal (tty) is usually the device (serial port, pty, etc.) from which the process was started, and which it uses for input or output. Not all processes have a controlling terminal. Kpm scans the `/dev` directory to determine the name of the terminal, but this might fail. To save space, only the two last characters of the tty name are shown (thus `/dev/ttyp6` is shown as p6).

MAJFLT

  Number of major faults that have occured. A page fault occurs when a process attempts to read or write from a memory page that is not present in RAM. A major page fault is when disk access is involved, such as swapping in and out memory pages.

MINFLT

  Number of minor faults that have occured. A page fault occurs when a process attempts to read or write from a memory page that is not present in RAM, or write to a page that isn't writeable. A minor fault is when there is no disk access involved, for instance when writing to a copy-on-write shared page.

TRS

  Text resident set size (in kilobytes). This is the size of the text (that is, executable code) of the process that is currently present in RAM.

DRS

  Data resident set size (in kilobytes). This is the size of the data (not executable code) of the process that is currently present in RAM.

SIZE

  Virtual image size of the process (in kilobytes). This is the total size of the image of the process. This includes all code, data, and shared libraries used by the process, including pages that have been swapped out.

SWAP

  Kilobytes on swap device. This is simply the difference between SIZE and RSS, in other words how much of a process that resides on disk.

RSS

  Resident set size (in kilobytes). This is the size of the part of the process (code and data) that actually resides in RAM, including shared libraries. This gives a fair approximation of how much RAM a process is using.

SHARE

  Shared memory (in kilobytes). This is the amount of memory that the process shares with other processes. It doesn't mean that any of it is actually used by any other process, just that it is possible.

DT

  Number of dirty pages. This is the number of (not the number of bytes) pages in RAM that have been modified since they were last written to disk. Dirty pages have to be written to disk before they are freed to be used for something else.

CMDLINE

  Command line that started the process. This the command line, including arguments, that started the process. Processes swapped out may show just the command name in parentheses. This is true for kernel processes as well.

### 2.1.2.4. Other Fields

PLCY

  Scheduling policy. FIFO (F) and Round-Robin (R) are realtime scheduling policies. Other (O) is the normal Unix time-sharing policy. F and R processes have a realtime priority between 1 and 99. A process will run as long as there is no runnable process with higher priority. Round-Robin processes will run for the length of one time-slice, after which they are placed last in the queue of their priority. FIFO processes run until they give up their CPU time (by sleeping or blocking) or are pre-empted by a process with higher priority. Only the super-user (root) may change the scheduling policy.

RPRI

  Realtime processes (FIFO and Round-Robin) have priorities between 1 and 99. A process will pre-empt any other process that has lower priority. Normal time-sharing processes (policy O) all have priority 0. Only the super-user (root) may change the realtime priority.

FLAGS

  Process flags (hexadecimal). This contains some additional information about the state of a process. Refer to the Linux kernel source for details.

WCHAN

  Function where process is sleeping. If the process is waiting for something to happen, this is the kernel function where it is stuck. Leading do_ or sys_ is stripped from the name to make it shorter.

%WCPU

  Weighted percentage of CPU. This is the percentage of CPU time the process is using, averaged over the last 30 seconds (exponentially decaying average).

START

  Time process started. This is when the process was created.

COMM

  Command that started the process. This is the command (file name) that started the process. Long names are truncated.

Prev | Home | Next
Introduction |  | Monitoring Resource Usage