Finding the amount of used memory by each process in Solaris

What is VSZ memory?

VSZ is short for Virtual Memory Size. It’s the total amount of memory a process may hypothetically access.

### fill out required <UserName> in following command to find the amount of used memory by each process.
### Output is in Kilobyte.

for i in ps -aef | grep -i <UserName> | awk '{print $2}';do ps -o vsz -p $i | grep -v VSZ; echo “PID:”$i;echo “——“;done;

Example: (for zabbix user)

find the amount of used memory for each zabbix process:

[root @ soltest]~ # for i in `ps -aef | grep -i zabbix | awk '{print $2}'`;do ps -o vsz -p $i | grep -v VSZ; echo "PID:"$i;echo "------";done;
13440
PID:18793
------
14752
PID:18796
------
14752
PID:18795
------
13792
PID:18801
------
13792
PID:18800
------
14592
PID:18794
------
13792
PID:18799
------
14752
PID:18797
------
13792
PID:18804
------
13792
PID:18803
------
PID:28379
------
13792
PID:18802
------
13792
PID:18806
------
13792
PID:18798
------
13792
PID:18805
------

Leave a Comment