Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

How to check how much memory a solaris process consumes? I'd like both total address space allocated and the amount that is resident in RAM.

I tried summing pmap output with some awk script, but it was an ugly hack. Is there a better way to script it?

share|improve this question

5 Answers 5

  1. prstat -s rss

    '-s' sorts prstat output by rss column (see man page for other columns). Also try '-a' option for a per user accumulation.

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

    Top 10 RAM consumers. '-o pmem' displays percentage of resident memory i.e. RAM used by process.

  3. ls -lh /proc/{pid}/as

    Easy way to show total address space (vsz) of a process. Useful in combination with pgrep to accumulate by user, pattern, ... e.g.:

    for pid in `pgrep -U webserver`; do ls -lh /proc/$pid/as; done
share|improve this answer

Well, after I've read through some man pages I got the following

ps -o vsz -p $PID | tail -1

It is quite straightforward. The format for resident size is rss.

share|improve this answer

Or maybe a dtrace-script?

share|improve this answer
Prstat is an obvious choice for interactive monitoring. –  Tadeusz A. Kadłubowski Oct 16 '09 at 13:11

I use variation of this output in scripts:

# prstat -Z 1 1 | tail -3
ZONEID    NPROC  SWAP   RSS MEMORY      TIME  CPU ZONE                        
220       56 1057M  413M   0.3%   1:26:49 0.1% 820f6ce5-7e37-4455-80ab-b28c5de19b43
Total: 56 processes, 169 lwps, load averages: 0.07, 0.06, 0.06
share|improve this answer

My $.02 as the Zenoss Community Manager...

Zenoss can monitor the health of all your network devices and servers, as well as the processes running on you servers. One of our Community members recently submitted Process Monitoring for Solaris via SNMP:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.