This command is very helpful if you want to have a big picture of memory usage on your unix server. For instance, we can generally know how much memory has been consumed by ZFS and Kernel processes.

2. prstat –t

Instead of command “prstat”, which report active process statistics, command prstat with opetion “-t” can report total usage summary for each user. The summary includes the total number of processes or LWPs owned by the user, total size of process images, total resident set size, total cpu time, and percentages of recent cpu time and system memory.

# prstat -t

NPROC USERNAME SWAP RSS MEMORY TIME CPU

377 oracle 16G 16G 50% 133:03:55 0.1%

37 root 198M 238M 0.7% 3:48:10 0.0%

1 noaccess 82M 163M 0.5% 3:07:53 0.0%

1 smmsp 1488K 9080K 0.0% 0:00:41 0.0%

2 daemon 2280K 8456K 0.0% 0:00:32 0.0%

Total: 418 processes, 6821 lwps, load averages: 0.65, 0.53, 0.59

3. ps -efo pmem,uid,pid,ppid,pcpu,comm | sort -r

This command can present the list of processes by sorting memory usage. It’s kindly helpful if you need such information.

# ps -efo pmem,uid,pid,ppid,pcpu,comm | sort -r

11.1 101 24515 1 0.0 ora_arc3_ORCL

11.1 101 24513 1 0.0 ora_arc2_ORCL

11.0 101 28509 1 0.0 ora_cjq0_ORCL

11.0 101 27673 1 0.0 oracleORCL

11.0 101 27671 1 0.0 oracleORCL

11.0 101 27669 1 0.0 oracleORCL

11.0 101 26911 1 0.0 oracleORCL

11.0 101 26868 1 0.0 oracleORCL

11.0 101 26866 1 0.0 oracleORCL

11.0 101 26852 1 0.0 oracleORCL

11.0 101 26850 1 0.0 oracleORCL

11.0 101 26833 1 0.0 oracleORCL

11.0 101 26827 1 0.0 oracleORCL

11.0 101 26799 1 0.0 oracleORCL

11.0 101 26788 1 0.0 oracleORCL

11.0 101 24585 1 0.0 ora_q001_ORCL

11.0 101 24537 1 0.0 ora_q000_ORCL

11.0 101 24523 1 0.0 ora_qmnc_ORCL

11.0 101 24519 1 0.0 ora_fbda_ORCL

11.0 101 24511 1 0.0 ora_arc1_ORCL

11.0 101 24509 1 0.0 ora_arc0_ORCL

11.0 101 24491 1 0.0 ora_s000_ORCL

11.0 101 24489 1 0.0 ora_d000_ORCL

11.0 101 24487 1 0.0 ora_mmnl_ORCL

11.0 101 24485 1 0.0 ora_mmon_ORCL

11.0 101 24483 1 0.0 ora_reco_ORCL

11.0 101 24481 1 0.0 ora_smon_ORCL

11.0 101 24479 1 0.0 ora_ckpt_ORCL

11.0 101 24477 1 0.0 ora_lgwr_ORCL

11.0 101 24475 1 0.0 ora_dbwf_ORCL

11.0 101 24473 1 0.0 ora_dbwe_ORCL

11.0 101 24471 1 0.0 ora_dbwd_ORCL

11.0 101 24469 1 0.0 ora_dbwc_ORCL

11.0 101 24467 1 0.0 ora_dbwb_ORCL

11.0 101 24465 1 0.0 ora_dbwa_ORCL

11.0 101 24463 1 0.0 ora_dbw9_ORCL

11.0 101 24461 1 0.0 ora_dbw8_ORCL

11.0 101 24459 1 0.0 ora_dbw7_ORCL

11.0 101 24457 1 0.0 ora_dbw6_ORCL

11.0 101 24455 1 0.0 ora_dbw5_ORCL

11.0 101 24453 1 0.0 ora_dbw4_ORCL

Alternatively, the following command can be used too to collect similar information.

ps -eo pid,pmem,vsz,rss,comm | sort -rnk2 | head

4./usr/proc/bin/pmap -x <process-id>

Processes have private memory to hold their stack space, heap, and data areas. The only way to see how much memory a process is actively using is to use above command. This command is available in Solaris 2.6 and later releases.

Please be noted that the value from the script and that in the OEM console may not match exactly as the script provides realtime values as the OEM console will shows the last value uploaded by the grid agent, but there should not be much difference between them. From running this script, we can briefly know the how much memory is utilized and how much are still free to use.

23 Responses to Different Ways to Check Memory Usage on Solaris Server

We are a gaggle of volunteers and starting a brand new scheme in our community. Your website provided us with useful information to work on. You have performed an impressive activity and our entire group might be thankful to you.