Memory Usage of a Solaris Container (Zone)

Last week one of my servers ran out of RAM and Swap. Shame on me for not monitoring that, but it's now.

As the server is running several zones, my first question was: Which zone is eating up my RAM? So, here are the commands I used.

Part 1: Find the Zone

To see the memory usage of the running zones:

prstat -Z

From the prstat(1M) man page:

Part 2: Find the Process(es) in the Zone

To see which processes use the most RAM in the zone, use one of these commands:

prstat -z zone -s rss
prstat -z zone -s size

From the prstat(1M) man page:

Note the upper case -Z in the first an the lower case -z in the second command.

For more information about prstat, see the manual prstat(1M).