How to Install TOP package in Solaris 10

Step-1: PreRequisites

For installation of top, download the following package.

# wget

Step-2: Extract Zip File

Extract top package using below command.

# gunzip top-3.6.1-sol10-sparc-local.gz

Step-3: Installation

Install and configure top package as given below:

# pkgadd -d top-3.6.1-sol10-sparc-local

The following packages are available:
  1  SMCtop     top
                (sparc) 3.6.1

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: 

Processing package instance  from 

top(sparc) 3.6.1
LeFebvre et al

The selected base directory  must exist before
installation is attempted.

Do you want this directory created now [y,n,?,q] y
Using  as the package base directory.
## Processing package information.
## Processing system information.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

Installing top as 

## Installing part 1 of 1.
[ verifying class  ]

Installation of  was successful.

Set Default Path

Set the default path of top command in user’s profile.

#echo $PATH
#vi ~.profile

How to Configure htop in Linux

Step-1: PreRequisites

For installation of htop following are the dependencies

# yum groupinstall "Development Tools"
# yum install ncurses-devel zlib-devel texinfo gtk+-devel gtk2-devel qt-devel tcl-devel tk-devel kernel-headers kernel-devel

Step-2: Installation and Configuration

Download and extract htop package from given URL:

cd /tmp
# wget
# tar -zxvf htop-0.9.tar.gz

Install and configure htop package as given below:

# cd htop-0.9
# ./configure
# make
# make install
# htop

How to Check Memory in Linux

Following are some useful commands to check the memory status of machine:

free Command

Use free command to check the memory, buffers, cache memory

# free -m
             total       used       free     shared    buffers     cached
Mem:          6082       5801        280          0        155       3887
-/+ buffers/cache:       1759       4322
Swap:         1707         33       1674

top Command

Top command tells the detailed information of CPU i.e time, load average, CPU utilization, memory, swap memory.

# top
top - 09:36:16 up 33 days, 16:47,  2 users,  load average: 0.49, 0.47, 0.52
Tasks: 157 total,   1 running, 155 sleeping,   1 stopped,   0 zombie
Cpu(s): 30.0%us,  2.4%sy,  0.0%ni, 67.0%id,  0.5%wa,  0.0%hi,  0.0%si,  0.1%st
Mem:   6228500k total,  5975956k used,   252544k free,   159264k buffers
Swap:  1748984k total,    34100k used,  1714884k free,  3980880k cached

11774 www-data  20   0 99.8m  56m 6780 S   55  0.9   1:02.52 apache2
21086 www-data  20   0  100m  54m 5620 S   39  0.9   0:04.14 apache2
21075 www-data  20   0 66524  19m 4848 S    4  0.3   0:21.04 apache2

htop Command

Install htop on server, htop command also tells the detailed information of CPU i.e time, load average, CPU utilization, memory, swap memory but in a nice format.

# htop

Check Memory Consumption Processes

Process that are eating more memory

# ps aux | awk '{print $2, $4, $11}' | sort -k2rn | head -n 20