Solaris: how to list swap space per process?

14,443

You can use the command:

pmap -S <pid>

to see all the memory statistics, including swap usage.

With little shell magic you can wrap it in a bash loop:

cd /proc
for i in *; do
    SWAP=`pmap -S $i | grep ^total | awk '{ print $3; }'`
    [ "xx$SWAP" != "xx" ] && echo "$SWAP bytes $i"
done | sort -n

Output is in bytes, in a format:

<number> bytes <pid>
Share:
14,443

Related videos on Youtube

dokaspar
Author by

dokaspar

Updated on September 18, 2022

Comments

  • dokaspar
    dokaspar over 1 year

    On Solaris, how can I find out how much swap space a given process is occupying? Or even better, how can I list all running processes sorted by swap space usage?

    I'm asking this particulary for Solaris. I do not have the top command available and neither prstat nor swap seem to be able to provide information about how much swap space a given process is using.