Using htop
The htop tool is a text-only, interactive process viewer. It is similar to the top tool, but with additional features:
- The process list is scrollable.
- The information on screen is configurable.
- You can use the touch display or keyboard to control screen items.
- Strace can be attached to a process with a single key press.
- The htop tool can show threads in addition to processes.
- TIME+ column value can be checked to find out process wake-ups (does the value increase).
The htop (or top) tool is mainly useful for checking whether memory usage changes. For accurate information on how much memory programs actually consume, use sp-memusage.
Packages
source: htop
binary: htop
Installing htop on the Harmattan device
Install htop through the developer mode applet.
Prerequisite: Developer mode must be enabled.
- Select Settings > Security > Developer mode.
- Install the Performance bundle package by clicking Install.
- You get a notification screen that lists all the applications to be installed in the bundle package. To install, click OK.
- A dependency notice appears. Click Accept.
For more information on developer mode and installable tools, see Activating developer mode.
Using the tool
You can run htop either in the terminal window of your host workstation or in the terminal tool available on the Harmattan device.
To use htop on your Harmattan device:
- Launch the application from the command line on the device. However, note that the touch display of the device does not currently support all the features of the tool, such as changing the sorting order of the generated output.
Note: For a comprehensive list of the available commands, see the manual reference pages for this tool.
The following sections give usage examples for the htop tool.
Monitoring the processes
To see the running processes, enter the following command:
htop
To show only processes owned by the root, enter the following command:
htop -u root
To show processes sorted by CPU usage (call htop --sort-key help
to see all sort keys), enter the following command:
htop --sort-key PERCENT_CPU
The following output is displayed:
CPU[########*********** 58.8%] Tasks: 198 total, 1 running Mem[|||||||||||||||##****236/479MB] Load average: 0.00 0.00 0.00 Swp[|||||| 87/456MB] Uptime: 24 days, 01:51:32 PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command 23852 root 20 0 2608 1044 828 R 23.0 0.2 0:00.15 htop --sort-key PE 1 root 20 0 3016 1416 876 S 0.0 0.3 0:02.71 /sbin/init 559 root 20 0 1912 484 396 S 0.0 0.1 0:06.46 udevd --daemon 762 root 15 -5 1948 560 524 S 0.0 0.1 0:00.01 /usr/sbin/cellmo-w 1006 root RT -5 1668 1608 1344 S 0.0 0.3 1:53.28 /sbin/dsme -p /usr 1084 root 20 0 2860 556 512 S 0.0 0.1 0:00.27 /sbin/klogd -n 1091 messageb 15 -5 4620 2660 880 S 0.0 0.5 0:18.71 /usr/bin/dbus-daem 1101 root -2 -5 6704 1352 1140 S 0.0 0.3 1:02.73 /sbin/dsme-server 1105 root -2 -1 6704 1352 1140 S 0.0 0.3 0:00.01 /sbin/dsme-server 1113 root 20 0 1768 636 580 S 0.0 0.1 0:10.75 /sbin/syslogd -n 1127 root 20 0 2076 924 736 S 0.0 0.2 0:04.83 -sh
If you are using the tool in the terminal window of your host workstation, you can change the sorting order by clicking the column headers.
Exiting the tool
To exit the tool, press 'q' or close the command-line terminal.
Further information
For more information on the tool, see the following link: